Page MenuHomeVyOS Platform

Add DHCP default route distance
Closed, ResolvedPublicFEATURE REQUEST

Description

From stillzy on Reddit (https://www.reddit.com/r/vyos/comments/lfe2zm/change_dhcp_default_metric/):

Change DHCP Default Metric

With EdgeOS it's possible to change the default route metric for DHCP Learned default routes, is this possible with VyOS?

Add dhcp-options default-route-distance configuration node.

Details

Difficulty level
Normal (likely a few hours)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Improvement (missing useful functionality)

Event Timeline

stepler changed the task status from Open to In progress.Feb 11 2021, 1:32 AM
stepler closed this task as Resolved.
stepler changed Difficulty level from Unknown (require assessment) to Normal (likely a few hours).

Wrong behavior

set high-availability vrrp group test interface 'eth1'
set high-availability vrrp group test rfc3768-compatibility
set high-availability vrrp group test virtual-address '172.20.110.111/24'
set high-availability vrrp group test virtual-address '172.20.110.15/24'
set high-availability vrrp group test vrid '1'
set interfaces ethernet eth1 address 'dhcp'
set interfaces ethernet eth1 dhcp-options default-route-distance '254'

That creates vrf name "eth1v1" and assigns the default route to that vrf. I don't use any vrf.

!
vrf eth1v1
 ip route 0.0.0.0/0 192.168.101.1 eth1 tag 210 254
 exit-vrf
!

I created a separate task for this because it was not caused by a previous commit. T3392

Viacheslav changed the task status from In progress to Needs testing.Mar 7 2021, 8:21 PM
stepler changed the task status from Needs testing to Backport candidate.Mar 8 2021, 3:38 PM

Looks good on 1.4-rolling-202103080218:

vyos@vyos:~$ configure
[edit]
vyos@vyos# set interfaces ethernet eth0 address dhcp
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# exit
Warning: configuration changes have not been saved.
exit
vyos@vyos:~$ 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

S>* 0.0.0.0/0 [210/0] via 192.168.251.1, eth0, weight 1, 00:00:03
C>* 192.168.251.0/24 is directly connected, eth0, 00:00:03
vyos@vyos:~$ configure
[edit]
vyos@vyos# set interfaces ethernet eth0 dhcp-options default-route-distance 220
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# exit
Warning: configuration changes have not been saved.
exit
vyos@vyos:~$ 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

S>* 0.0.0.0/0 [220/0] via 192.168.251.1, eth0, weight 1, 00:00:01
C>* 192.168.251.0/24 is directly connected, eth0, 00:00:01
vyos@vyos:~$ show version

Version:          VyOS 1.4-rolling-202103080218
Release Train:    sagitta

Built by:         autobuild@vyos.net
Built on:         Mon 08 Mar 2021 02:18 UTC
Build UUID:       4debd270-2278-4f2e-84eb-200965ec8b40
Build Commit ID:  e758a269e84509

Architecture:     x86_64
Boot via:         installed image
System type:      KVM guest

Hardware vendor:  QEMU
Hardware model:   Standard PC (Q35 + ICH9, 2009)
Hardware S/N:     
Hardware UUID:    06d0fd71-2f1e-4e2f-a29c-79dc6ca82ca9

Copyright:        VyOS maintainers and contributors

Looks good on 1.3-rolling-202103280642:

vyos@vyos:~$ configure
[edit]
vyos@vyos# set interfaces ethernet eth0 address dhcp
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# exit
Warning: configuration changes have not been saved.
exit
vyos@vyos:~$ 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 route, r - rejected route

S>* 0.0.0.0/0 [210/0] via 192.168.251.1, eth0, 00:00:02
C>* 192.168.251.0/24 is directly connected, eth0, 00:00:02
vyos@vyos:~$ configure
[edit]
vyos@vyos# set interfaces ethernet eth0 dhcp-options default-route-distance 220
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# exit
Warning: configuration changes have not been saved.
exit
vyos@vyos:~$ 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 route, r - rejected route

S>* 0.0.0.0/0 [220/0] via 192.168.251.1, eth0, 00:00:01
C>* 192.168.251.0/24 is directly connected, eth0, 00:00:01
vyos@vyos:~$ show version

Version:          VyOS 1.3-rolling-202103280642
Release Train:    equuleus

Built by:         autobuild@vyos.net
Built on:         Mon 29 Mar 2021 03:42 UTC
Build UUID:       a3b25a73-a77e-440d-9000-099e5b504cd2
Build Commit ID:  56ecc5b821b2f0

Architecture:     x86_64
Boot via:         installed image
System type:      KVM guest

Hardware vendor:  QEMU
Hardware model:   Standard PC (Q35 + ICH9, 2009)
Hardware S/N:     
Hardware UUID:    688112b3-7dd7-42b5-9642-83ab9b7242ee

Copyright:        VyOS maintainers and contributors
SrividyaA set Issue type to Improvement (missing useful functionality).Aug 31 2021, 10:56 AM