FRRouting / frr

The FRRouting Protocol Suite

Home Page:https://frrouting.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zebra not restore routes

ak503 opened this issue · comments

zebra not restore routes when have more then one iface with common network and one iface is flaping (up, then get ip)

prepare:
1: run frr
2:

ip link add dev dum1 type dummy ; \
ip addr add 192.168.1.1/24 dev dum1; \
ip link set up dev dum1; \
ip link add dev dum2 type dummy ; \
ip addr add 192.168.1.2/24 dev dum2; \
ip link set up dev dum2;

3:

vtysh -c "c t" -c "ip route 5.5.5.5/32 192.168.1.254 dum2"

all ok:

vtysh -c "show ip route"
S>* 5.5.5.5/32 [1/0] via 192.168.1.254, dum2, weight 1
C * 192.168.1.0/24 is directly connected, dum2
C>* 192.168.1.0/24 is directly connected, dum1
L>* 192.168.1.1/32 is directly connected, dum1
L>* 192.168.1.2/32 is directly connected, dum2

good state: get ip, then UP:

ip link delete dev dum2 ; \
sleep 1; \
ip link add dev dum2 type dummy ;\
sleep 1; \
ip addr add 192.168.1.2/24 dev dum2; \
sleep 1; \
ip link set up dev dum2;
vtysh/vtysh -c "show ip route"
S>* 5.5.5.5/32 [1/0] via 192.168.1.254, dum2, weight 1
C * 192.168.1.0/24 is directly connected, dum2
C>* 192.168.1.0/24 is directly connected, dum1
L>* 192.168.1.1/32 is directly connected, dum1
L>* 192.168.1.2/32 is directly connected, dum2

bad state: UP, then get ip:

ip link delete dev dum2 ; \
sleep 1; \
ip link add dev dum2 type dummy ; \
sleep 1; \
ip link set up dev dum2; \
sleep 1;\
ip addr add 192.168.1.2/24 dev dum2;
vtysh/vtysh -c "show ip route"
S   5.5.5.5/32 [1/0] via 192.168.1.254, dum2 inactive, weight 1
C * 192.168.1.0/24 is directly connected, dum2
C>* 192.168.1.0/24 is directly connected, dum1
L>* 192.168.1.1/32 is directly connected, dum1
L>* 192.168.1.2/32 is directly connected, dum2

Which version of FRR, kernel, distro?

frr-master/6.5.0-35/Ubuntu 22.04.4
also on
frr-10.0/ 4.15.0-142 /Ubuntu 16.04.7
frr-master/ 4.15.0-142 /Ubuntu 16.04.7

@ton31337 I’m not completely sure, but I think that the situation is due to UNNUMBERED interfaces: if I revert the patch a79fdd6 then I get a good route:
S>* 5.5.5.5/32 [1/0] via 192.168.1.254, dum2 onlink ...

S   5.5.5.5/32 [1/0] via 192.168.1.254, dum2 inactive, weight 1
C * 192.168.1.0/24 is directly connected, dum2
C>* 192.168.1.0/24 is directly connected, dum1

But.. that's correct, dum2 is not selected as best, and that's why it's inactive (you clearly demand dum2 to be used for a static route).

yes, I'm setting up a route via dum2 and assuming it will be restored after the interface is restore

different behavior: "get addr + up" vs "up + get addr"