Page MenuHomeVyOS Platform

[DHCP]removes default route
Confirmed, Requires assessmentPublicBUG

Description

hi Team.

I've been testing an issues with regarding removing the dhcp address on an interface .By default it removes the DF associate to next-hop , but if I add a static route with the same next-hop , it's also removed .therefore , loses the internet connectivity /any network known through the default route. let me show:

version vyos 1.2.8:

vyos@vyos# run show version
Version:          VyOS 1.2.8
Release Train:    crux

Built by:         Sentrium S.L.
Built on:         Mon 21 Jun 2021 17:21 UTC
Build UUID:       0acd8f9d-7cd3-48b7-b9c8-64d83e6183a0
Build Commit ID:  4ed04df4311601

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

Hardware vendor:  QEMU
Hardware model:   Standard PC (i440FX + PIIX, 1996)
Hardware S/N:     Unknown
Hardware UUID:    Unknown

Copyright:        VyOS maintainers and contributors

i add a DF with the same next-hop:

vyos@vyos# run 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.122.1, eth0, 00:00:48
C>* 192.168.122.0/24 is directly connected, eth0, 00:00:50
[edit]
vyos@vyos# run show interfaces
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface        IP Address                        S/L  Description
---------        ----------                        ---  -----------
eth0             192.168.122.189/24                u/u
eth1             -                                 u/u
eth2             -                                 u/u
eth3             -                                 u/u
lo               127.0.0.1/8                       u/u
                 ::1/128

vyos@vyos# set protocols static route 0.0.0.0/0 next-hop 192.168.122.1
[edit]
vyos@vyos# commit

vyos@vyos# run 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 [1/0] via 192.168.122.1, eth0, 00:00:23
C>* 192.168.122.0/24 is directly connected, eth0, 00:04:25
[edit]

So I add a new ipv4 address and remove the dhcp services :

vyos@vyos# set interfaces ethernet eth0 address 192.168.122.150/24
[edit]
vyos@vyos# delete interfaces ethernet eth0 address dhcp
[edit]
vyos@vyos# compare
[edit interfaces ethernet eth0]
-address dhcp
+address 192.168.122.150/24
[edit]
vyos@vyos# commit
[ interfaces ethernet eth0 address dhcp ]
Stopping DHCP client on eth0 ...

we can see that it removes the static/DF :

vyos@vyos# run 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

C>* 192.168.122.0/24 is directly connected, eth0, 00:00:19
[edit]

when you use AWS the default interface is on dhcp , so you want to change a static' ipv4 , you have the same problem.

Details

Difficulty level
Normal (likely a few hours)
Version
VyOS 1.2.8/1.2.7
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)

Event Timeline

Viacheslav changed the task status from Open to Confirmed.Mon, Sep 13, 8:33 AM
Viacheslav edited projects, added VyOS 1.2 Crux (VyOS 1.2.9); removed VyOS 1.2 Crux.

To reproduce:

set interfaces ethernet eth0 address 'dhcp'
set protocols static route 0.0.0.0/0 next-hop 192.168.122.1

We get configuration:

!
ip route 0.0.0.0/0 192.168.122.1 210
!

We expect configuration:

!
ip route 0.0.0.0/0 192.168.122.1
ip route 0.0.0.0/0 192.168.122.1 eth0 210
!

Delete protocols:

vyos@r12-lts# delete protocols 
[edit]
vyos@r12-lts# commit
[edit]
vyos@r12-lts# vtysh -c "show run staticd"
Building configuration...

Current configuration:
!
frr version 7.3.1-20210105-01-g092b787
frr defaults traditional
hostname r12-lts
log syslog
log facility local7
service integrated-vtysh-config
!
line vty
!
end
[edit]
vyos@r12-lts#

FRR behaviour without "interface" in route - it replaced metric with value without metric

r12-lts(config)# ip route 0.0.0.0/0 192.168.122.1
r12-lts(config)# 
r12-lts(config)# do sho run | include 0.0.0.0
ip route 0.0.0.0/0 192.168.122.1
r12-lts(config)# 
r12-lts(config)# ip route 0.0.0.0/0 192.168.122.1 210
r12-lts(config)# 
r12-lts(config)# do sho run | include 0.0.0.0
ip route 0.0.0.0/0 192.168.122.1 210
r12-lts(config)# 
r12-lts(config)# ip route 0.0.0.0/0 192.168.122.1
r12-lts(config)# 
r12-lts(config)# do sho run | include 0.0.0.0
ip route 0.0.0.0/0 192.168.122.1
r12-lts(config)# 
r12-lts(config)# ip route 0.0.0.0/0 192.168.122.1 eth0 210
r12-lts(config)# 
r12-lts(config)# do sho run | include 0.0.0.0
ip route 0.0.0.0/0 192.168.122.1
ip route 0.0.0.0/0 192.168.122.1 eth0 210
r12-lts(config)#

In 1.3 we use interface + tag + metric for dhcp routes