But interestingly enough it does not say how to actually make that happen in terms of the commands. I am sure it assumes the reader already knows what those commands are, but it is not always the case, as with me.
Would anyone be so kind as to help me out?
I am trying to make sure all bridged networks stay within the 172.* range.
I hate it when people find answers and don’t contribute to the good of others. So, after looking around, here is what I found.
I use Ubuntu 18.04, which uses netplans instead of /etc/network/interfaces.
Using route add (which does not survive reboots), if you wanted to make sure docker does not use any 192.168.* addresses for creating networks, you would do something like:
route add -net 192.168.0.0/16 gw [your gateway ip] dev [your network device, i.e. eth0]
Using netplan, you would add this to /etc/netplan/01-netcfg.yaml (under the proper device, at the same level as gateway and nameservers):
routes:
- to: 192.168.0.0/16
via: [your gateway ip]
And then execute netplan apply
After that, you can kill any containers using networks with IPs you don’t want, and recreate them.