rootless-containers / slirp4netns

User-mode networking for unprivileged network namespaces
GNU General Public License v2.0
715 stars 82 forks source link

Unable to connect to remote host: No route to host #299

Closed ocafebabe closed 2 years ago

ocafebabe commented 2 years ago

Hi,

I'm running a rootless podman container with the default network setting (which is using slirp4netns) and I can't reach an external host because it's on the same subnet as the container:

telnet 10.0.2.103
Trying 10.0.2.103...
telnet: Unable to connect to remote host: No route to host

It works if I switch to host networking mode but I would rather stay with the default one.

Is there some sort of workaround to make this work? I did a lot of Googling and didn't find anything...

Thanks,

Christian

ocafebabe commented 2 years ago

Never mind, I was able to get around the issue by passing a custom CIDR to slirp4netns, e.g.:

podman run --rm -it --network=slirp4netns:cidr=10.0.5.0/24 ubuntu:20.04 bash

Sorry for the disturbance...