0

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?

symcbean
  • 219

1 Answers1

0

Although I had configured a static address which was being applied to the interface, the system was still running DHCP (see /var/lib/NetworkManager/dhclient*) and populating the default route (as well as the DNS servers).

I fixed the problem by removing the interface and all associated config then adding the interface but connected to a vlan with no dhcp rebuilding it (ticking all the relevant checkboxes in nmtui). I now only have one gateway - but there are still issues with the second interface.

symcbean
  • 219