Page MenuHomeVyOS Platform

FRR not setting default gateway from dhcp
Closed, ResolvedPublicBUG


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
  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 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 $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.


Difficulty level
Unknown (require assessment)
Why the issue appeared?
Will be filled on close

Event Timeline

yun created this task.Feb 17 2019, 1:39 PM
yun updated the task description. (Show Details)
pasik added a subscriber: pasik.Mar 12 2019, 5:18 PM
hagbard claimed this task.Apr 5 2019, 7:35 PM
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 awaiting review, I have no commit privs.

hagbard reassigned this task from hagbard to UnicronNL.Apr 5 2019, 9:55 PM
hagbard added a subscriber: hagbard.
yun added a comment.Apr 16 2019, 11:27 AM

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?

@yun it's only that single line.

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

runar added a subscriber: runar.Apr 16 2019, 6:27 PM

@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

UnicronNL added a comment.EditedApr 16 2019, 6:59 PM

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

ok. @UnicronNL please reject my PR then. thx.

yun added a comment.EditedApr 16 2019, 7:48 PM

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

ip route before renewing dhcp:

# ip route
default via dev eth0 proto static metric 20 dev eth0 proto kernel scope link src

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

# ip route dev eth0 proto kernel scope link src

(note it misses default gateway)
# vtysh -c "conf t" -c "ip route 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.

UnicronNL added a subscriber: dmbaturin.EditedApr 16 2019, 8:49 PM

@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.
yun added a comment.Apr 23 2019, 7:02 PM

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?

yun added a comment.EditedApr 23 2019, 7:47 PM

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)
dmbaturin closed this task as Resolved.Aug 27 2019, 5:57 AM

If it reappears, feel free to reopen.

c-po moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.Oct 13 2019, 3:06 PM