Page MenuHomeVyOS Platform

no-default-route not being honoured
Closed, ResolvedPublicBUG

Description

I just created the following configuration:

vif 10 {
  address dhcp
  address dhcpv6
  description "WAN Interface to **** via VLAN 10"
  dhcp-options {
      no-default-route
  }
  dhcpv6-options {
      pd 0 {
          interface eth1 {
              address 1
              sla-id 0
          }
          length 56
      }
  }
}

Expecting that when I commited this the current default route via my PPPoE interface wouldn't be affected.
However, my router still learnt a default route via DHCP:

tim@ferrari# run show ip route                                                            
<snip>                                             
                                                                                         
S>* 0.0.0.0/0 [210/0] is directly connected, pppoe0, weight 1, 00:00:36                  
  *                   via X.X.192.1, eth1.10, weight 1, 00:00:36                     
S>* 10.0.0.0/8 [1/0] via 192.168.0.15, eth1, weight 1, 03w0d17h                          
B>* 10.1.1.0/24 [20/0] via 10.89.90.1, wg1, weight 1, 03w0d17h

I have worked around this at the moment by doing default-route-distance 220 as well:

tim@ferrari# run show ip route 
<snip>
S   0.0.0.0/0 [220/0] via X.X.192.1, eth1.10, weight 1, 00:05:34
S>* 0.0.0.0/0 [210/0] is directly connected, pppoe0, weight 1, 00:10:03

Possibly related to https://vyos.dev/T4482 though I note if I manually request a DHCP lease refresh, it refreshes the default as well.

Details

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

Event Timeline

tjh triaged this task as Normal priority.
tjh created this object in space S1 VyOS Public.
tjh updated the task description. (Show Details)
Viacheslav raised the priority of this task from Normal to High.Apr 20 2024, 5:51 AM
Viacheslav changed the subtype of this task from "Task" to "Bug".

Just as another data-point - I have found that leaving the DHCP lease to auto-renew itself (not me doing it manually) that it doesn't then add it to the routing table.
i.e. at the moment my DHCP client is still connected, but there's no default via the DHCP session at the moment.

Are you sure your DHCP server honors the no-default-route option?
I may be wrong, but I think the no-default-route just sets an option in the DHCP request, asking the DHCP server to not send back the default route.
I have the same issue with my ISP, and they told me they will always send a default route via DHCP.
I have solved the issue using DHCP hooks.

Are you sure your DHCP server honors the no-default-route option?
I may be wrong, but I think the no-default-route just sets an option in the DHCP request, asking the DHCP server to not send back the default route.
I have the same issue with my ISP, and they told me they will always send a default route via DHCP.
I have solved the issue using DHCP hooks.

You are correct, https://github.com/vyos/vyos-1x/blob/260645d0c6ff078cc89601f3a586195902f9c18e/data/templates/dhcp-client/ipv4.j2#L39
we do not request a default route from the DHCP server if this is configured.

Having an ISP that does now honor this option is a different story.

Viacheslav reassigned this task from Viacheslav to MattK.
Viacheslav moved this task from Open to Finished on the VyOS 1.5 Circinus board.
Viacheslav moved this task from Backlog to Finished on the VyOS 1.4 Sagitta (1.4.3) board.
Viacheslav subscribed.
dmbaturin changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.