Connect docker containers directly to the host subnet

I am having some problems trying to connect docker containers directly to the host network.

The configuration is as follows One host has one interface (eth0) in the subnet, say 10.0.15.0/24. IP on eth0 is 10.0.15.5/24. I configured the docker0 bridge to use the subnet on the subnet accessible from eth0, namely 10.0.15.64/26. This way the docker can use the IP addresses from this / 26 to provide containers, and I want the containers to be directly accessible from the rest of the network. Docker Bridge also has an IP set, namely 10.0.15.65/26.

When a container is created, it receives an IP, for example 10.0.15.66/26. Now, I have done some pinging tests:

  • anything on the network can ping 10.0.15.5 (host eth0)
  • anything on the network can ping 10.0.15.65 (docker0 host bridge)
  • host can ping 10.0.15.66 (ip container)
  • a container can ping anything on the network
  • nothing but the host can not ping the container 10.0.15.66

IP Forwarding Enabled

[root@HOSTNAME~]# cat /proc/sys/net/ipv4/ip_forward
1

What am I missing here? Containers connected to docker0 bridge should be accessible from the network, I think.

Expected Behavior Containers should be pingable from anywhere on the network, just like docker0 bridge, etc.

Any thoughts or help would be greatly appreciated!

+4
source share
1 answer
, , . , , . MAC- , . , .

, , , . NIC promiscuous, , MAC.

+2

All Articles