LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-24-2020, 12:43 PM   #1
King Arthur
LQ Newbie
 
Registered: Oct 2010
Posts: 23

Rep: Reputation: 1
default route lost after pulling and reconnecting network cable


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.103
After 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 enp3s0
How 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.0
 
Old 11-25-2020, 01:25 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
/etc/network/interfaces is probably still being considered by systemd, but I think you should take a little time to configure systemd to completely take over your fixed connection, now that you purged network-manager.
https://wiki.archlinux.org/index.php/Systemd-networkd
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Packet going out of wrong interface due to OS adding cache route - OS trying to route through default route msr1981 Linux - Networking 2 10-11-2017 02:58 PM
Packet going out of wrong interface due to OS adding cache route - OS trying to route through default route msr1981 Red Hat 1 10-09-2017 05:45 AM
network connection doesn't work after reconnecting cable on newer kernels phil.d.g Slackware 1 12-20-2005 03:52 PM
Route dialup modem packets back through dialup instead of default route cable modem jogress Linux - Networking 1 10-21-2003 03:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration