Score:0

How to chose internet source for Docker container on Ubuntu

my flag

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

ru flag
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?
ru flag
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.
dummyuser avatar
uy flag
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 avatar
uy flag
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.
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.