Why my "route add" command has time-limited effect?

by taalf   Last Updated September 14, 2018 16:02 PM

I have searched over the net, but I tried everything and nothing works for me...

First, I need to delete problematic lines in the routine table.

The route table looks like this (addresses are hidden):

$ route -n
Kernel IP routing table
Destination Gateway     Genmask         Flags Metric Ref    Use Iface
0.0.0.0     $ADDRESS_2  0.0.0.0         UG    50     0        0 tap0
0.0.0.0     $ADDRESS_1  0.0.0.0         UG    100    0        0 enp3s0
$ADDRESS_3  $ADDRESS_1  255.255.255.255 UGH   100    0        0 enp3s0
$ADDRESS_4  0.0.0.0     255.255.0.0     U     1000   0        0 enp3s0
$ADDRESS_5  0.0.0.0     255.255.255.0   U     100    0        0 enp3s0
$ADDRESS_6  $ADDRESS_2  255.255.255.0   UG    50     0        0 tap0
$ADDRESS_7  0.0.0.0     255.255.255.0   U     50     0        0 tap0

We tried lots of commands to remove the first line, which contains the bad address $ADDRESS_2, but nothing works...

$ sudo route del default
$ sudo route del -net 0.0.0.0 gw $ADDRESS_2
$ sudo route del -net 0.0.0.0 gw $ADDRESS_2 netmask 0.0.0.0
$ (...)

Then we tried to add a line with lower metric, so that the problematic line is ignored:

$ sudo route add default gw $ADDRESS_1 metric 40

and... this works.

$ route -n
Kernel IP routing table
Destination Gateway     Genmask         Flags Metric Ref    Use Iface
0.0.0.0     $ADDRESS_1  0.0.0.0         UG    40     0        0 enp3s0
0.0.0.0     $ADDRESS_2  0.0.0.0         UG    50     0        0 tap0   # ignored :-P
(...)

BUT

after few time this added line disappears without any visible reason, and I must add again the line by hand, and this again and again all day long...

Would be very grateful for any help...



Related Questions


how to see specific established connections?

Updated June 07, 2015 11:00 AM

Output only mac address on Ubuntu

Updated May 26, 2015 13:00 PM


How to get pc-name from IP address?

Updated February 18, 2016 02:01 AM