Page MenuHomeVyOS Platform

Incorrect behaviour of static routes with overlapping networks
Closed, ResolvedPublicBUG

Description

If static route of large prefix (10.0.0.0/8) overlaps with next hop morescpec prefix (nhop 10.230.230.1/30)
Then after down/up interface static route (10.0.0.0/8) don't present in network stack.

R1 - eth1 10.230.230.2/30 | static route 10.0.0.0/8 nh 10.230.230.1
R2 - eth1 10.230.230.1/30 | dum0 10.0.0.1/32

To reproduce this:
R1

set interfaces ethernet eth1 address '10.230.230.2/30'
set protocols static route 10.0.0.0/8 next-hop 10.230.230.1

R2

set interfaces ethernet eth1 address '10.230.230.1/30'
set interfaces dummy dum0 address '10.0.0.1/32'

From R1 ping R2 and show routing table before down/up interface eth1

vyos@r1# run show ip route 10.0.0.1
Routing entry for 10.0.0.0/8
  Known via "static", distance 1, metric 0, best
  Last update 00:12:42 ago
  * 10.230.230.1, via eth1

[email protected]# run ping 10.0.0.1 count 1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=0.872 ms

--- 10.0.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.872/0.872/0.872/0.000 ms
[edit]

vyos@r1# sudo  ip route | grep 10.0
10.0.0.0/8 via 10.230.230.1 dev eth1 proto static metric 20

Disable/Enable inteface eth1 (or plug/unplug cable)

vyos@r1# set interfaces ethernet eth1 disable
[edit]
vyos@r1# commit
[edit]
vyos@r1# delete interfaces ethernet eth1 disable 
[edit]
vyos@r1# commit

Check routing table after down/up interface, ping loss 100%

vyos@r1# run show ip route 10.0.0.1
Routing entry for 10.0.0.0/8
  Known via "static", distance 1, metric 0, best
  Last update 00:19:06 ago
  * 10.230.230.1, via eth1

vyos@r1# run ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
^C
--- 10.0.0.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3053ms

vyos@r1# sudo  ip route | grep 10.0
[edit]
vyos@r1#

It looks like this bug with FRR versions.
Everything works correctly with version FRR 7.3

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.2.3
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

syncer changed the task status from Open to In progress.Jan 6 2020, 12:52 AM
syncer assigned this task to zsdc.
syncer triaged this task as Normal priority.

In FRR 7.0.1 (VyOS 1.2.3) was some bug, due to which static routes were not updated (maybe, not in all cases or environments) after the next-hop state change. In VyOS 1.2.4 we use stable FRR 7.2, which processes this situation without problems. An example (key point from FRR debug log):
FRR 7.0.1:

Jan 13 15:29:51 vyos zebra[1041]: 0:10.230.230.0/30: Adding route rn 0x5612ea69d1f0, re 0x5612ea69d370 (type 2)
Jan 13 15:29:51 vyos zebra[1041]: 0:10.230.230.0/30: Redist update re 0x5612ea69d370 (type 2), old (nil) (type -1)
Jan 13 15:29:51 vyos zebra[1041]: 0:10.230.230.0/30: Adding route rn 0x5612ea69d490, re 0x5612ea69e110 (type 2)
Jan 13 15:29:51 vyos zebra[1041]: 0:10.230.230.0/30: Redist update re 0x5612ea69e110 (type 2), old (nil) (type -1)
Jan 13 15:29:51 vyos zebra[1041]: NHT processing check for zvrf default
Jan 13 15:29:51 vyos zebra[1041]: 0:10.230.230.1/32: Evaluate RNH, type 0
Jan 13 15:29:51 vyos zebra[1041]: 0:10.230.230.1/32: NH resolved over route 10.230.230.0/30
Jan 13 15:29:51 vyos zebra[1041]: 0:10.230.230.1/32: Notifying client static about NH
Jan 13 15:29:51 vyos zebra[1041]: 0:192.168.20.1/32: Evaluate RNH, type 0

FRR 7.2:

Jan 13 15:33:23 vyos zebra[1042]: 0:10.230.230.0/30: Adding route rn 0x5574620a18b0, re 0x5574620a1930 (connected)
Jan 13 15:33:23 vyos zebra[1042]: 0:10.230.230.0/30: Adding route rn 0x5574620a29b0, re 0x5574620a1850 (connected)
Jan 13 15:33:23 vyos zebra[1042]: 0:10.230.230.0/30 update_from_ctx(): no fib nhg
Jan 13 15:33:23 vyos zebra[1042]: 0:10.230.230.0/30 update_from_ctx(): rib nhg matched, changed 'true'
Jan 13 15:33:23 vyos zebra[1042]: 0:10.230.230.0/30: Redist update re 0x5574620a1930 (connected), old 0x0 (None)
Jan 13 15:33:23 vyos zebra[1042]: 0:10.230.230.1/32: Evaluate RNH, type Nexthop
Jan 13 15:33:23 vyos zebra[1042]: 0:10.230.230.1/32: NH resolved over route 10.230.230.0/30
Jan 13 15:33:23 vyos zebra[1042]: 0:10.230.230.1/32: Notifying client static about NH
Jan 13 15:33:23 vyos zebra[1042]: rib_add_multipath: 0:10.0.0.0/8: Inserting route rn 0x5574620a1b10, re 0x5574620a1a30 (static) existing (nil)
Jan 13 15:33:23 vyos zebra[1042]: 0:10.0.0.0/8: Adding route rn 0x5574620a1b10, re 0x5574620a1a30 (static)
Jan 13 15:33:23 vyos zebra[1042]: netlink_route_multipath(): RTM_NEWROUTE 10.0.0.0/8 vrf 0(254)
Jan 13 15:33:23 vyos zebra[1042]: netlink_route_multipath() (single-path): nexthop via 10.230.230.1  if 3(0)
Jan 13 15:33:23 vyos zebra[1042]: netlink_talk: netlink-dp (NS 0) type RTM_NEWROUTE(24), len=60 seq=10 flags 0x501
Jan 13 15:33:23 vyos zebra[1042]: 0:10.0.0.0/8 update_from_ctx(): no fib nhg
Jan 13 15:33:23 vyos zebra[1042]: 0:10.0.0.0/8 update_from_ctx(): rib nhg matched, changed 'true'
Jan 13 15:33:23 vyos zebra[1042]: 0:10.0.0.0/8: Redist update re 0x5574620a1a30 (static), old 0x0 (None)

So, configured static routes updating properly.

dmbaturin renamed this task from Incorrect work static routing to Incorrect behaviour of static routes with overlapping networks.Feb 4 2020, 10:00 PM