Score:0

set up 2 network insolated docker containers

io flag

I have 2 network interfaces: ens4 ( 10.142.0.0/24 ) & ens5 ( 10.10.0.0/24 ) on Google compute engine VPC.

Having two default routes added in Ubuntu such that traffic from one can go to one and two goes to two using following script

sudo ifconfig ens5 10.10.0.7 netmask 255.255.255.255 broadcast 10.10.0.7 mtu 1430
echo "1 rt1" | sudo tee -a /etc/iproute2/rt_tables
sudo ip route add 10.10.0.1 src 10.10.0.7 dev ens5 table rt1
sudo ip route add default via 10.10.0.1 dev ens5 table rt1
sudo ip rule add from 10.10.0.7/24 table rt1
sudo ip rule add to 10.10.0.7/24 table rt1

Now everything is ok apache on port 80/443 working on both NIC perfectly.

now ....

my objective is docker container-1 should have all traffic from ens4 ( 10.142.0.0/24 ) interface and docker container-2 should have all traffic from ens5 ( 10.10.0.0/24 )

How can I achieve this?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.