Score:0

How is the default gateway determined when centos is running in a docker instance connected to multiple macvlan's

in flag

I have a docker instance of Centos 7.8 that is connected to 5 networks via 5 macvlan's configured on the host. Everything is working perfectly except that I cant figure out how to define a default gateway inside this Centos docker. Normally I would expect to be able to configure '/etc/sysconfig/network' and|or '/etc/sysconfig/network-scripts/' but neither the 'network' file nor 'network-scripts' folder exist.

The end goal is that I need to change the default route to a different interface. I'm assuming this has something to do with how the network config is built in the instance, but i cant find anything pointing me in the right direction. I can successfully change the default route using:

ip route replace default via *.*.*.* dev eth*

But as expected this is not persistent between docker instance stop/start.

--- ADDITIONAL INFORMATION ---

SETTING UP DOCKER:

docker run \
-dit \
-e TZ=America/Toronto \
--name=ddns \
--hostname=ddns \
--domainname=xxx.xxx.xx \
--ip=172.16.11.11 \
--net=macvlan11 \
--dns=127.0.0.1 \
--restart=unless-stopped \
--cap-add=NET_ADMIN \
cent7-dnsmasq \
dnsmasq -k

ADDING ADDITIONAL CONNECTIONS:

docker network connect \
--ip=172.16.10.11 \
macvlan10 \
ddns

docker network connect \
--ip=172.16.12.11 \
macvlan12 \
ddns

docker network connect \
--ip=172.16.13.11 \
macvlan13 \
ddns

docker network connect \
--ip=172.16.14.11 \
macvlan14 \
ddns

docker network connect \
--ip=172.16.15.11 \
macvlan15 \
ddns
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.