Unfortunately the solution provided to a similar question does not seem to apply here; it explains how to override the settings for DHCP. I have 2 static interfaces.
The system was working as expected with a single interface, but in order to access a second network, I added a second interface (it's a VM, and yes, there are reasons why I can't handle the traffic on the current interface).
I shut the VM down to add the new interface, and when it started up, the OS recognized the interface and decided that, since it did not have any configuration information, it would run DHCP - it did, it got an address and (another) default gateway. I updated the config /etc/netplan/01-netcfg-yaml and ran a netplan update. Networkd said the config was "not for us".
So I tried adding the config directly in /etc/systemd/network/11-ens192.network After both a restart of the network and a reboot of the system, despite using the manually assigned IP address, the default route previously supplied va DHCP re-appears.
I've searched every file in the /etc directory and find no mention of the router address - but it keeps reappearing after reboot.
find /etc -type f -exec grep -H 10.1.0.254 {} \;
I can delete the route from the command line - but it still comes back after a reboot!
How do I get rid of this?
Use this connection only for resources on its network
. When you check it, route will not be created for this network/adapter. I guess, there must be an option to configure that via netplan files. – nobody Sep 18 '19 at 17:34