Page MenuHomeVyOS Platform

Cannot create ipv4 static route for default gateway in vrf
Closed, ResolvedPublicBUG

Description

After ipv4 static route is created in VRF it is nowhere to be found.

The command (it seems that syntax is different from what documentation says ...but I like it):

r2# set vrf name mgmt protocols static route 0.0.0.0/0 next-hop 192.168.1.1

The config:

r2# show vrf
 name mgmt {
     protocols {
         static {
             route 0.0.0.0/0 {
                 next-hop 192.168.1.1 {
                 }
             }
         }
     }
     table 100
 }
[edit]

Here is the resulting vrf:

r2:~$ show ip route vrf mgmt
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, q - queued, r - rejected, b - backup

VRF mgmt:
K>* 0.0.0.0/0 [255/8192] unreachable (ICMP unreachable), 08:21:40
C>* 192.168.1.0/24 is directly connected, eth2, 08:21:40

and here is the default table:

r2:~$ 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, q - queued, r - rejected, b - backup

O>* 10.11.2.0/23 [110/1003] via 23.153.128.125, tun0, weight 1, 08:19:16
O>* 10.11.97.0/24 [110/1003] via 23.153.128.125, tun0, weight 1, 08:19:16
O>* 10.11.144.0/24 [110/1003] via 23.153.128.125, tun0, weight 1, 08:19:16
O>* 10.11.186.0/24 [110/1003] via 23.153.128.125, tun0, weight 1, 08:19:16
S>* 23.153.128.0/24 [1/0] is directly connected, tun0, weight 1, 08:22:54
O>* 23.153.128.1/32 [110/3] via 23.153.128.125, tun0, weight 1, 08:22:48
O>* 23.153.128.2/32 [110/3] via 23.153.128.125, tun0, weight 1, 08:22:48
O>* 23.153.128.116/30 [110/1022] via 23.153.128.125, tun0, weight 1, 08:19:16
O>* 23.153.128.120/30 [110/1002] via 23.153.128.125, tun0, weight 1, 08:22:48
O   23.153.128.124/30 [110/2] is directly connected, tun0, weight 1, 08:22:54
C>* 23.153.128.124/30 is directly connected, tun0, 08:23:02
O>* 23.153.128.129/32 [110/1002] via 23.153.128.125, tun0, weight 1, 08:19:16
O>* 23.153.128.192/26 [110/1003] via 23.153.128.125, tun0, weight 1, 08:19:16
C>* 96.127.249.100/32 is directly connected, pppoe0, 08:23:02
O>* 192.168.1.0/24 [110/1003] via 23.153.128.125, tun0, weight 1, 08:19:16

I've tried restarting frr and rebooting the router withj no avail.

Am I doing something wrong or is it actually a bug?

Details

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

Event Timeline

Something wrong in your configuration

It is a directly connected route

C>* 192.168.1.0/24 is directly connected, eth2, 08:21:40

The directly connected prefix will be always preferred.

Yes, I made mistake when adding the command to the ticket and I corrected it now. It should read:

set vrf name mgmt protocols static route 0.0.0.0/0 next-hop 192.168.1.1

BTW, the same setup for ipv6 works fine

dtoux renamed this task from Cannot create ipv4 static route in vrf to Cannot create ipv4 static route for default gateway in vrf.Mar 23 2021, 4:02 PM
Viacheslav changed the task status from Open to Confirmed.EditedMar 23 2021, 4:17 PM

I can confirm:

set interfaces ethernet eth1 address '100.64.0.1/24'
set interfaces ethernet eth1 vrf 'mgmt'
set vrf name mgmt protocols static route 0.0.0.0/0 next-hop 100.64.0.254
set vrf name mgmt protocols static route 203.0.113.0/24 next-hop 100.64.0.254 
set vrf name mgmt table '1005'

Routes

vyos@r1-roll# run show ip route vrf mgmt 
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, q - queued, r - rejected, b - backup

VRF mgmt:
K>* 0.0.0.0/0 [255/8192] unreachable (ICMP unreachable), 00:01:19
C>* 100.64.0.0/24 is directly connected, eth1, 00:01:19
[edit]
vyos@r1-roll#
c-po changed the task status from Confirmed to In progress.Mar 23 2021, 5:37 PM
c-po claimed this task.

We have two problems here

  • the execution here is yet not possible with vyos-configd
  • also wihthout configd the routes are not always applied into FRR - still investigating

Please try with the next rolling release - issue should be fixed

c-po changed the task status from In progress to Needs testing.Mar 23 2021, 8:02 PM

I will give it a try once the image is out. The latest right now is still showing 2021-03-23.

Fixed VyOS 1.4-rolling-202103251004

vyos@r5:~$ show ip route vrf foo
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, q - queued, r - rejected, b - backup

VRF foo:
S>* 0.0.0.0/0 [1/0] via 192.168.101.1, eth1, weight 1, 00:00:09
K * 0.0.0.0/0 [255/8192] unreachable (ICMP unreachable), 05:00:10
B>* 100.64.0.0/24 [20/0] via 192.168.101.145, eth1, weight 1, 04:37:18
B>* 100.64.1.0/24 [20/0] via 192.168.101.145, eth1, weight 1, 04:37:18
B>* 100.64.2.0/24 [20/0] via 192.168.101.145, eth1, weight 1, 04:37:18
B>* 100.64.3.0/24 [20/0] via 192.168.101.145, eth1, weight 1, 04:37:18
O   192.168.101.0/24 [110/1] is directly connected, eth1, weight 1, 02:13:22
C>* 192.168.101.0/24 is directly connected, eth1, 05:00:07
O>* 192.168.122.0/24 [110/2] via 192.168.101.145, eth1, weight 1, 02:10:22
S>* 203.0.113.0/24 [1/0] via 192.168.101.145, eth1, weight 1, 00:00:49