Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple NIC and Docker containers

I'm trying to solve specific problem regarding Docker containers and routing.

A Docker host is running several network interfaces (3G USB modems), each having internet access. So, in short;

eth0 - WAN IP 1
ppp0 - WAN IP 2
ppp1 - WAN IP 3
ppp2 - WAN IP 4

How to specify which NIC each container should use if I want container to use a specific one?

like image 687
nnn21 Avatar asked Sep 19 '26 04:09

nnn21


1 Answers

Yes I ahed very similar issue. Unfortunately I had to use VirtualBox for this to work properly.

I have used Vagrant to create VirtualBox Virtual Machine and provisioned it with Ansible and then changed default route of that VM. Something like this:

route add default gw IP2

That would mean creating 4 different VM's but thats how I would approach the problem.

like image 154
Polinux Avatar answered Sep 20 '26 18:09

Polinux