Page MenuHomeVyOS Platform

DHCP default route duplicated when moving interface between VRFs
Closed, ResolvedPublicBUG

Description

When moving an interface with a DHCP default route between VRFs, the default route isn't removed from the old VRF.


Setup:

set interfaces ethernet eth0 address dhcp
commit
sleep 10
vtysh -c 'show running-config'
Building configuration...

Current configuration:
!
frr version 8.4.2
frr defaults traditional
hostname vyos
log syslog
log facility local7
service integrated-vtysh-config
!
ip route 0.0.0.0/0 192.168.128.1 eth0 tag 210 210
!
rpki
exit
!
end

Note the presence of a default route in the default VRF.


Bug:

set vrf name MGMT table 100
set interfaces ethernet eth0 vrf MGMT
commit
vtysh -c 'show running-config'
Building configuration...

Current configuration:
!
frr version 8.4.2
frr defaults traditional
hostname vyos
log syslog
log facility local7
service integrated-vtysh-config
!
ip route 0.0.0.0/0 192.168.128.1 eth0 tag 210 210
!
vrf MGMT
 ip route 0.0.0.0/0 192.168.128.1 eth0 tag 210 210
exit-vrf
!
rpki
exit
!
end

Note the default route wasn't removed from the default VRF.

Details

Version
1.4-rolling-202303170317
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

Viacheslav changed the task status from Open to Needs testing.Jan 20 2024, 12:12 PM
Viacheslav triaged this task as Normal priority.
dmbaturin changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.
dmbaturin changed Issue type from Unspecified (please specify) to Bug (incorrect behavior).
dmbaturin subscribed.

Still reproducible in a sagitta build from 2024-12-02.

c-po changed the task status from Needs testing to In progress.Feb 4 2025, 6:53 PM

Confirmed for:

  • 1.4.1
  • 1.4-stable-202502050953
  • 1.5-stream-202502051856

Not affected:

  • 1.5-rolling-202502050918 (but it lacks the default route after interface move)
cpo@LR1.wue3# run show ip route vrf red
Codes: K - kernel route, C - connected, L - local, 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, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF red:
K>* 127.0.0.0/8 [0/0] is directly connected, red, weight 1, 00:00:16
C>* 172.16.33.0/24 is directly connected, eth0.10, weight 1, 00:00:16
L>* 172.16.33.102/32 is directly connected, eth0.10, weight 1, 00:00:16

cpo@LR1.wue3# run renew dhcp interface eth0.10
Restarting DHCP client on interface eth0.10...
[edit]
cpo@LR1.wue3# run show ip route vrf red
Codes: K - kernel route, C - connected, L - local, 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, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF red:
S>* 0.0.0.0/0 [210/0] via 172.16.33.254, eth0.10, weight 1, 00:00:01
K>* 127.0.0.0/8 [0/0] is directly connected, red, weight 1, 00:00:58
C>* 172.16.33.0/24 is directly connected, eth0.10, weight 1, 00:00:01
K * 172.16.33.0/24 [0/0] is directly connected, eth0.10, weight 1, 00:00:01
L>* 172.16.33.102/32 is directly connected, eth0.10, weight 1, 00:00:01

The reason for this issue (lacking default route after VRF move) is related to /sbin/dhclient not beeing restarted after it has been moved to a different VRF. It will complain about: dhclient[5843]: receive_packet failed on eth0.10: Network is down

https://github.com/vyos/vyos-1x/pull/4335