default route with linkdown
11,717
In new kernel we have new defaults. Solution is
echo 1 > /proc/sys/net/ipv4/conf/enp0s10/ignore_routes_with_linkdown
echo 1 > /proc/sys/net/ipv4/conf/enp0s18/ignore_routes_with_linkdown
And make new default
echo net.ipv4.conf.all.ignore_routes_with_linkdown=1 > /etc/sysctl.d/10-linkdown.conf
sysctl -p /etc/sysctl.d/10-linkdown.conf
Related videos on Youtube
Author by
eri
Updated on September 18, 2022Comments
-
eri over 1 year
If no link on enp0s18 i have
root@route:~# ip r default via a.a.a.1 dev enp0s18 metric 10 linkdown default via a.a.b.1 dev enp0s10 metric 20 onlink linkdown default via x.x.x.49 dev wwx001e101f0000 metric 30
Expected that default swiches to x.x.x.49, but it tries
linkdown
routeroot@route:~# ping -n ya.ru PING ya.ru (87.250.250.242) 56(84) bytes of data. From a.a.a.231 icmp_seq=1 Destination Host Unreachable From a.a.a.231 icmp_seq=2 Destination Host Unreachable From a.a.a.231 icmp_seq=3 Destination Host Unreachable ^C
Link state
4: enp0s10: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether 1c:af:f7:08:27:e2 brd ff:ff:ff:ff:ff:ff 5: enp0s18: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether 00:13:d3:14:83:f1 brd ff:ff:ff:ff:ff:ff
Result: Traffic black-holed
-
eri over 5 yearsCreate this file. If you have no /etc/sysctl.d/ dir - append this "net.ipv4.conf.all.ignore_routes_with_linkdown=1" to /etc/sysctl.conf
-
Nikita over 5 yearsBut there is no /etc/sysctl.conf as well
-
eri over 5 yearscreate it. look to dmesg to check
-
AJ Smith 'Smugger' over 3 yearsWhy have you not accepted your own answer? It does work...