July 31, 20232 yr Hi, I have an onboard RJ45 + a quad port Intel I350-T4. The onboard port (eth0) is set on 192.168.10.12 and is connected to my default vlan. I'm trying to setup a custom Docker network so that all my containers are running inside a different vlan. I've configured the port (eth2) for the containers to use 192.168.41.2 as you can see here. If I set a container to use the network "Custom : br2 -- Docker", the container gets a unique IP in the 192.168.41.X range which is the expected behavior. What I want is to get all my containers running behind the IP I've configured for this interface (192.168.41.2) so for that I created a custom docker network using the following command: docker network create -o com.docker.network.bridge.name=br2 apps Now when I set a container to use the newly created "apps" network, it gets an "internal" ip in the 172.X.X.X range (which is what I want) but this range gets behind the 192.168.10.12 IP instead of 192.168.41.2. Any idea what I'm doing wrong here? Thank you in advance for helping me sort that issue out!
October 16, 20232 yr Have you seen this topic? I used to do the same thing but with no luck, it seems that the custom docker network created with "bridge" driver can't be attached to any physical NIC, because it is mediated by layer 3 forwarding and NAT rules in your iptables nat table, so maybe you can make it work with some iptables management, see stackoverflow - How to make docker only use a eth1 interface to communicate with other hosts?
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.