Page MenuHomeVyOS Platform

Static routing tables are not created with dhcp route
Needs testing, NormalPublicBUG

Description

Static tables don't appear to be created in latest 1.4 when using dhcp-interface route

vyos@vyos# show protocols static table 200
 route 0.0.0.0/0 {
     dhcp-interface eth1
 }
[edit]
vyos@vyos# run show ip route table 200
[edit]
vyos@vyos# ip route list table 200
Error: ipv4: FIB table does not exist.
Dump terminated

Interface:

vyos@vyos:~$ show int eth eth1
eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:09 brd xx:xx:xx:xx:xx:ff
    inet xxx.xxx.175.191/18 brd xxx.xxx.191.255 scope global dynamic eth1
...

Details

Difficulty level
Unknown (require assessment)
Version
1.4-rolling-202305030317
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

sarthurdev renamed this task from Static routing tables are not created to Static routing tables are not created with dhcp route.May 3 2023, 10:46 PM
sarthurdev updated the task description. (Show Details)

Works in my test

set protocols static table 200 route 192.0.2.35/32 dhcp-interface 'eth4'

Show ip route

vyos@vyos2:~$ vtysh -c "show ip route table 200"
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, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF default table 200:
S>* 192.0.2.35/32 [1/0] via 10.x.x.254, eth4, weight 1, 00:35:46
vyos@vyos2:~$

Did you execute renew dhcp interface ethX after adding route?

It might be a boot/slow DHCP lease issue.

The protocols_static.py conf script checks at runtime for a dhcp router. At boot, the lease might not exist yet and no route is created.

I think we need to add a dhcp client hook to call protocols_static.py to refresh any dhcp based routes.

This comment was removed by Viacheslav.
Viacheslav changed the task status from Open to Needs testing.Jan 20 2024, 12:35 PM
Viacheslav triaged this task as Normal priority.

@sdev Can you reproduce it?