0

Containers are basically using the internet interface that my "Ubuntu 22.04.1 LTS" is using but once I have multiple internet source I don't know how to make the container's use another source for accessing internet

I'm just lost and need some help as Im new to linux

This is how it is enter image description here

This is how I want it enter image description here

Artur Meinild
  • 21,605
  • 21
  • 56
  • 89
Anessk.16
  • 1
  • 1
  • This will require advanced NAT configuration, if you're new to Ubuntu this will be very difficult to achieve unless you've configured each of your docker bridges with specific IP ranges. How are your docker bridges currently created? Or do you simply run docker compose files, etc. to bring up different projects and thus have different bridges for each thing? – Thomas Ward Dec 05 '22 at 16:46
  • Note that by default Docker installs a 'MASQUERADE' rule that says it just goes out over your primary internet connection without restriction, so changing it to use a different connection requires you to do some advanced networking configuration. However, we will require more information on how your docker bridges are configured on system in order to determine the exact rules you need to put into place. – Thomas Ward Dec 05 '22 at 16:51
  • Hi @Anessk.16. Welcome to askubuntu. You did not mention which Version on Ubutu you 're using. As Thomas mentioned your 3 docker-bridge interfaces must have different IP Ranged, the ranges must not change. Normally routing makes it decision which outgoing interface to use based on the target address. What you want now is different, you want to make the routimg decision based on the source address. – dummyuser Dec 05 '22 at 17:07
  • Modern Ubuntu systems describe this behaviour as policy-based routing (earlier called source based routing). See [netplan examples](https://netplan.io/examples). NAT(Masquerading) is simple, it is needed on each pppX interface. The configuration may differ on the used ubuntu Version. Depending on your skills this may be a nice challenge. – dummyuser Dec 05 '22 at 17:10

0 Answers0