If on two routers with the redistribution of static routes enabled, create the same routes and then delete them, the route will loop.
сonfiguration router 1 (vyos1):
```
interfaces {
ethernet eth0 {
address 192.168.0.1/24
}
loopback lo {
}
}
protocols {
ospf {
area 0 {
network 192.168.0.0/24
}
redistribute {
static {
}
}
}
}
service {
ssh {
```
сonfiguration router 2 (vyos2):
```
interfaces {
ethernet eth0 {
address 192.168.0.2/24
}
loopback lo {
}
}
protocols {
ospf {
area 0 {
network 192.168.0.0/24
}
redistribute {
static {
}
}
}
}
service {
ssh {
```
```
vyos@vyos1:~$ show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL
192.168.0.2 1 Full/DR 31.039s 192.168.0.2 eth0:192.168.0.1 0 0 0
```
Create a route on a router 1:
```
vyos@vyos1:~$ conf
vyos@vyos1# set protocols static route 192.168.100.0/24 blackhole
vyos@vyos1# commit
vyos@vyos1# exit
```
```
vyos@vyos2:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric,
> - selected route, * - FIB route
O 192.168.0.0/24 [110/1] is directly connected, eth0, 00:08:04
C>* 192.168.0.0/24 is directly connected, eth0, 00:09:19
O>* 192.168.100.0/24 [110/20] via 192.168.0.1, eth0, 00:01:03
vyos@vyos2:~$ conf
vyos@vyos2# set protocols static route 192.168.100.0/24 blackhole
vyos@vyos2:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric,
> - selected route, * - FIB route
O 192.168.0.0/24 [110/1] is directly connected, eth0, 00:09:59
C>* 192.168.0.0/24 is directly connected, eth0, 00:11:14
S>* 192.168.100.0/24 [1/0] unreachable (blackhole), 00:00:30
O 192.168.100.0/24 [110/20] via 192.168.0.1, eth0, 00:00:40
```
Remove the route on both routers:
```
vyos@vyos1# delete protocols static route 192.168.100.0/24
vyos@vyos1# commit
vyos@vyos2# delete protocols static route 192.168.100.0/24
vyos@vyos2# commit
```
And show:
```
vyos@vyos1:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric,
> - selected route, * - FIB route
O 192.168.0.0/24 [110/1] is directly connected, eth0, 00:11:31
C>* 192.168.0.0/24 is directly connected, eth0, 00:13:28
O>* 192.168.100.0/24 [110/20] via 192.168.0.2, eth0, 00:02:47
```
```
vyos@vyos2:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric,
> - selected route, * - FIB route
C>* 10.244.8.0/24 is directly connected, eth1, 00:16:35
O 192.168.0.0/24 [110/1] is directly connected, eth0, 00:11:09
C>* 192.168.0.0/24 is directly connected, eth0, 00:12:24
O>* 192.168.100.0/24 [110/20] via 192.168.0.1, eth0, 00:01:50
vyos@vyos2:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric,
> - selected route, * - FIB route
O 192.168.0.0/24 [110/1] is directly connected, eth0, 00:11:28
C>* 192.168.0.0/24 is directly connected, eth0, 00:12:43
O>* 192.168.100.0/24 [110/20] via 192.168.0.1, eth0, 00:02:09
```
Now I got a route loop. The problem is solved by rebooting routers.