rootlesskit icon indicating copy to clipboard operation
rootlesskit copied to clipboard

How to allow containers access to LAN

Open mavhc opened this issue 3 years ago • 3 comments

Is there a way to allow containers to access the LAN that the host is on?

I've tried with specified bridge networks:

# wget http://192.168.0.1
Connecting to 192.168.0.1 (192.168.0.1:80)
wget: can't connect to remote host (192.168.0.1): Connection refused
# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.112.1   0.0.0.0         UG    0      0        0 eth0
192.168.112.0   *               255.255.240.0   U     0      0        0 eth0

And with ipvlan network:

# wget http://192.168.0.1
Connecting to 192.168.0.1 (192.168.0.1:80)
# wget: can't connect to remote host (192.168.0.1): Host is unreachable
# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.77.60.1      0.0.0.0         UG    0      0        0 eth0
10.77.60.0      *               255.255.255.0   U     0      0        0 eth0
192.168.0.0     *               255.255.255.0   U     0      0        0 eth1
192.168.112.0   *               255.255.240.0   U     0      0        0 eth2

mavhc avatar Apr 17 '22 21:04 mavhc

Sorry, I don’t get the context.

AkihiroSuda avatar Apr 22 '22 17:04 AkihiroSuda

Sorry, running rootless docker, from within a container, should I be able to access computers on the same network as the host machine? I can from a docker container running as root.

Access to computers on the internet is working fine, as is access to other containers on the same docker network

mavhc avatar May 04 '22 08:05 mavhc