Closed shenwii closed 10 months ago
Check podman unshare --rootless-netns ip addr
, you should see a tap0 interface there, also check if slirp4netns is running.
Did you try to reboot? Or at least stop all containers then rm $XDG_RUNTIME_DIR/netns/rootless-netns-*
@Luap99
$ podman unshare --rootless-netns ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host proto kernel_lo
valid_lft forever preferred_lft forever
2: tap0: <BROADCAST,UP,LOWER_UP> mtu 65520 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether 1e:a8:37:6a:8b:83 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.100/24 brd 10.0.2.255 scope global tap0
valid_lft forever preferred_lft forever
inet6 fe80::1ca8:37ff:fe6a:8b83/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
3: podman1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 0a:58:a2:6c:c9:51 brd ff:ff:ff:ff:ff:ff
inet 192.168.10.1/24 brd 192.168.10.255 scope global podman1
valid_lft forever preferred_lft forever
inet6 fd52:2a5a:747e:3acd::1/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::402e:38ff:fe05:4a24/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
18: veth0@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master podman1 state UP group default qlen 1000
link/ether 0a:58:a2:6c:c9:51 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet6 fe80::858:a2ff:fe6c:c951/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
19: veth3@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master podman1 state UP group default qlen 1000
link/ether 62:f3:ae:83:a3:53 brd ff:ff:ff:ff:ff:ff link-netnsid 3
inet6 fe80::60f3:aeff:fe83:a353/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
20: veth4@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master podman1 state UP group default qlen 1000
link/ether f2:90:f9:f8:7b:d3 brd ff:ff:ff:ff:ff:ff link-netnsid 4
inet6 fe80::f090:f9ff:fef8:7bd3/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
21: veth1@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master podman1 state UP group default qlen 1000
link/ether c2:a7:85:17:65:dc brd ff:ff:ff:ff:ff:ff link-netnsid 1
inet6 fe80::c0a7:85ff:fe17:65dc/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
22: veth2@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master podman1 state UP group default qlen 1000
link/ether 86:56:a2:9c:b6:eb brd ff:ff:ff:ff:ff:ff link-netnsid 2
inet6 fe80::8456:a2ff:fe9c:b6eb/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
23: veth5@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master podman1 state UP group default qlen 1000
link/ether e2:cd:1f:42:2a:a0 brd ff:ff:ff:ff:ff:ff link-netnsid 5
inet6 fe80::e0cd:1fff:fe42:2aa0/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
tap0 interface is exists.
$ ps -ef | grep slirp4netns
pod 2317 1 0 Jan08 ? 00:00:17 /usr/bin/slirp4netns --disable-host-loopback --mtu=65520 --enable-sandbox --enable-seccomp --enable-ipv6 -c -r 3 --netns-type=path /run/user/3000/netns/rootless-netns-d47816ac6169a5f68d2a tap0
pod 355666 354980 0 13:56 pts/0 00:00:00 grep slirp4netns
also slirp4netns is running.
I tried rebooting, but it didn't work.
I'll try stopping all containers and deleting $XDG_RUNTIME_DIR/netns/rootless-netns-*
If reboot didn't work you do not need to try and stop the containers. Slirp4netns is running and the tap0 interface is there so that looks good so the problem must be somewhere else.
Do you have a ipv4 internet connection? I know ipv6 still causes some troubles. Also you can just run podman unshare --rootless-netns
this should drop you in your shell in the this namespace so you can test if ping/curl works there correctly.
@Luap99 Thanks a lot, that reminds me, the reason is that my routing is misconfigured.
Issue Description
When I run the container with podman specifying network, the container has no way to access the internet.
Steps to reproduce the issue
1.add some conf to sysctl
2.apply it
# sysctl -p
3.create podman network$ podman network create --subnet 192.168.10.0/24 --gateway 192.168.10.1 --subnet fd52:2a5a:747e:3acd::/64 --gateway fd52:2a5a:747e:3acd::1 testnet
Describe the results you received
1.when run container with testnet, it's
NG
2.when run container with default podman network, it's also
NG
3.but when i run container without network option is
OK
Describe the results you expected
podman run container with network can't connect to internet
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
No
Additional environment details
Debian testing
Additional information
No response