Article 5AT9Z default route lost after pulling and reconnecting network cable

default route lost after pulling and reconnecting network cable

by
King Arthur
from LinuxQuestions.org on (#5AT9Z)
I'm running a small server with Debian:
Quote:
Debian GNU/Linux 10 (buster)
4.19.0-12-amd64 #1 SMP Debian 4.19.152-1 (2020-10-18) x86_64 GNU/Linux
I uninstalled the network manager with "apt purge network-manager" and configured the network interfaces in /etc/network/interfaces (one interface with two VLANs). This has been working flawlessly for almost two years. But after unpowering the network switch or pulling and plugging the network cable the default route is gone and as a consequence many services stop working. I assume that the problem exists from the start but that the situation triggering this has not occured until now.

If the problem appears only the routes to the local subnets are still there (output of "route -n"):
Code:Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 enp3s0.200
192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 enp3s0.103After restarting networking ("systemctl restart networking") the routing table is back to normal:
Code:Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.3.1 0.0.0.0 UG 0 0 0 enp3s0.103
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 enp3s0.200
192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 enp3s0.103
192.168.99.0 0.0.0.0 255.255.255.0 U 0 0 0 enp3s0How can I guarantee that the default route remains set or at least is set again after connecting the network? And apparently the is a mechanism that removes the rout, but where can I find it?

For reference the file "/etc/network/interfaces" (/etc/network/interfaces.d/ is empty):
Code:source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp3s0
iface enp3s0 inet static
address 192.168.99.14/24

auto enp3s0.200
iface enp3s0.200 inet static
vlan-raw-device enp3s0
address 192.168.1.14
netmask 255.255.255.0

auto enp3s0.103
iface enp3s0.103 inet static
vlan-raw-device enp3s0
address 192.168.3.14
gateway 192.168.3.1
netmask 255.255.255.0latest?d=yIl2AUoC8zA latest?i=RzRwuJjjcRY:KyAt81G3OwE:F7zBnMy latest?i=RzRwuJjjcRY:KyAt81G3OwE:V_sGLiP latest?d=qj6IDK7rITs latest?i=RzRwuJjjcRY:KyAt81G3OwE:gIN9vFwRzRwuJjjcRY
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments