Page MenuHomeVyOS Platform

FRR not setting default gateway from DHCP
Closed, ResolvedPublicBUG

Description

It seems FRR doesn't seem to set the default gateway from the DHCP lease when having custom routing tables.

Steps to reproduce (can be reproduced from livecd):

  1. Boot VyOS (tested on rolling 2019-02-16)
  2. Set eth0 to dhcp:
set interfaces ethernet eth0 address dhcp
commit
  1. Get address and if you do show ip route, you will see a default route
  2. Now add a custom routing table (use another interface or a vtun):
set protocols static table 100 interface-route 0.0.0.0/0 next-hop-interface eth1
  1. Now disconnect eth0, and reconnect so it will "renew" it's lease.
  2. You will see it will assign ip address but when you do: "ip route" you will see there is no default gateway.

Tracked it down to the following script: /sbin/dhclient-script, in update_routers(), it will do:

vtysh -c "conf t" -c "ip route 0.0.0.0/0 $router $ZEBRA_ROUTE_DHCP" >/dev/null 2>&1

If i execute the command manually it won't work either.. So maybe an issue in FRR?
If i modify update_routers() to add the "ip -4 route add ..." version to it, it will work but ofcourse this bypasses FRR.

Details

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

Event Timeline

yun updated the task description. (Show Details)
hagbard changed the task status from Open to On hold.Apr 5 2019, 7:37 PM
This comment was removed by hagbard.
hagbard changed the task status from On hold to In progress.Apr 5 2019, 8:02 PM
hagbard changed the task status from In progress to Confirmed.
hagbard changed the task status from Confirmed to On hold.Apr 5 2019, 9:54 PM

https://github.com/vyos/vyos-replace/pull/1 awaiting review, I have no commit privs.

I would to see this committed. But do we also know what causes the issue? Is it with FRR or was this script just missing the ip command to set the default gw?

@hagbard that commit sets a kernel route. that is not good.

@hagbard This commit adds a route to the kernel routingtable and bypassing FRR, this is no good and this would break. Please make the script add the appropiate commands to frr instead. This way frr will be in charge of populating the kernel table. Also note that this route needs to be removed on dhcp release

@yun What is the exact frr command you tried?
the command you tried manually.

@yun What is the exact frr command you tried?
the command you tried manually.

ip route before renewing dhcp:

# ip route
default via 192.168.156.2 dev eth0 proto static metric 20
192.168.156.0/24 dev eth0 proto kernel scope link src 192.168.156.134

ip route after adding the table 100 with interface route, and disconnecting/reconnecting eth0 :

# ip route
192.168.156.0/24 dev eth0 proto kernel scope link src 192.168.156.134

(note it misses default gateway)
# vtysh -c "conf t" -c "ip route 0.0.0.0/0 192.168.156.2 210"

after the vtysh command it still misses the default gateway in ip route.
If i delete table 100, and issue renew dhcp interface eth0, it gets the default route. It seems it's caused by the interface-route option.

@yun thanks
@dmbaturin Any idea how we can address this?
@hagbard closed request

syncer changed the task status from On hold to Confirmed.Apr 17 2019, 7:59 PM
syncer reassigned this task from UnicronNL to dmbaturin.
syncer triaged this task as Normal priority.
syncer edited projects, added VyOS 1.3 Equuleus; removed VyOS 1.2 Crux.
syncer added a subscriber: UnicronNL.

Is this a FRR bug or something else? Because I don't use any BGP stuff I just added the ip -4 route add command to my VM, so it's always executed. However, as @runar mentioned, it will bypass FRR. But executing the command via FRR didn't work, so the issue must be in FRR?

Hi all, I can confirm that with vyos-1.2.0-rolling+201904160337-amd64, this issue is fixed.
If I boot the older 2019-02-16 version, the bug can be reproduced easily. So it must be an issue in FRR that is introduced in 7.1 as the newer livecd uses FRR 7.0:

  • 2019-02-16 - FRRouting (version 7.1-dev) (issue present)
  • 2019-04-16 - FRRouting (version 7.0-20190411-01-g799dae6) (issue not present)

If it reappears, feel free to reopen.

dmbaturin renamed this task from FRR not setting default gateway from dhcp to FRR not setting default gateway from DHCP.Sep 29 2021, 1:40 PM
dmbaturin set Is it a breaking change? to Perfectly compatible.
dmbaturin set Issue type to Bug (incorrect behavior).