How to set up 2 network isolated Docker containers (front and back-end)

Making this work might sound crazy, but if Docker has to be comparable in functionalities already provided by other types of virtualization, then this has to work right? Ok, this is the scenario, is a classic one: I need to deploy in one Docker host, 2 isolated containers, let’s say front-end and back-end. The Linux host will have 2 NICs, each one with a different subnet. Each container will use a different NIC and external subnet. For Docker this means 2 docker networks (fe-bridge and be-bridge), which translates to 2 Linux bridges. Traffic between containers is not allowed internally, it has to go to the external network where there is a Firewall. External management traffic will go directly to the containers but each one through its respective physical NIC. And of course, everything is connected to Internet. ...

August 6, 2021 · 9 min · 1907 words · Adrian Giacometti

How to configure 1 Linux host with 2 NICs and 2 Default Gateways

Historically, it was not possible to have 2 default gateways in a Linux host. You can SEND traffic to both NICs, but the reply will always come from the NIC which has the default gateway. This will generate asymmetric traffic and it will be denied in the network or by the originating host. Asymmetric traffic means that the packets will go back using a different path. In this case by ping to NIC1 the return will be sent by NIC2. ...

August 5, 2021 · 3 min · 460 words · Adrian Giacometti