Hi all,
I’ve got a host which straddles 3 networks:
-
home
: is a OpenVPN L2 link to my home network, and is dual-stack, I don’t use this for a default IPv4 gateway, but I can use this network for public IPv6 access. Network interface has two addresses:192.168.1.2/24
and2001:db8:1000::2/64
. -
office
: is a local Ethernet link to my workplace’s office network. It too, is dual-stack and is used as the default gateway on IPv4 and IPv6. Two addresses:10.20.30.40/24
and2001:db8:2000::1234/64
. -
project
: is a local Ethernet link to the project network at my workplace. I can use it as a default route, but it’s mainly there so that I can interact with devices on that network, particularly for protocols like BACnet that don’t line traversing subnets.
Now, I read this article which describes how to set up multiple routing tables. I actually did this for my workplace’s border router, which has two Internet connections, and when I got that working there, I applied the concepts to my own workstation. Things worked great, except Docker.
It seems Docker, when it creates new bridges, will implicitly create routes in the default routing table, but it knows nothing about the custom ones I’ve created for the other interfaces. This results in packets getting mis-directed. My containers can’t ping my host, or anything outside. If I add a suitable route to one of my custom routing tables, things work. However, the dynamic nature of bridges in Docker makes this an impractical solution.
I wonder if there’s some kind of hook I can employ so that when docker0
or br-XXXXXXXX
is created, I can have a script called with the bridge name and IP subnets listed, for me to add those routes to my other routing tables?