Docker Community Forums

Share and learn in the Docker community.

Unable to connect to containers with custom network, likely IP conflict


(Dkalenscher) #1

I am trying to set up a custom docker network on the subnet 10.100.0.0/19 and allow my containers to be reachable from other devices on this subnet.

10.100.0.1 through 10.100.0.9 are reserved for network equipment and other devices.

My host server for Docker is at 10.100.0.10, pointing at a gateway of 10.100.0.1

I am trying to create the docker network with the following command:

docker network create --subnet=10.100.0.0/19 --gateway=10.100.0.1 equipsim-network

The network successfully creates and I can set up a container on this network and specify its IP (ex. 10.100.0.20) without a problem. I can ping it locally, however I cannot access it from the network.

I have forwarded ipv4, I can also ping the bridge interface.

I believe the problem is that when I use the network create command and specify its gateway as 10.100.0.1, the inet gets set to that as well:

br-e579d37939a9: mtu 1500 qdisc noqueue state UP

link/ether removed brd ff:ff:ff:ff:ff:ff

inet 10.100.0.1/19 brd 10.100.31.255 scope global br-e579d37939a9

valid_lft forever preferred_lft forever

inet6 fe80::42:26ff:febb:2077/64 scope link

valid_lft forever preferred_lft forever

I believe there is an IP conflict because of this since the inet is now 10.100.0.1/19 which is the IP of my switch.

What is the proper way to set this up?