"dhcp-options no-default-route" not working

I do not need the dhcp interface install default route. Use the fllowing command:

set interfaces ethernet eth2 dhcp-options no-default-route

But “show ip route” shows the default route still exist.

S>* 0.0.0.0/0 [210/0] via 13.44.255.254, eth2, weight 1, 00:00:05
C>* 13.44.0.0/16 is directly connected, eth2, 00:00:05

Try to disable eth2 and re-enable it, same issue.
I try to add “static route 0.0.0.0/0 via eth2”, after commit, then del the “static route 0.0.0.0/0 via eth2”, the default route disaperaed.
Tested with Version: VyOS 1.5-rolling-202309170024 VyOS 1.4-rolling-202309040919

ethernet eth2 {
    address dhcp
    dhcp-options {
        no-default-route
    }
    hw-id 00:0c:29:69:28:86
}

Try renewing the DHCP interface

renew dhcp interface eth2

release dhcp interface eth2
renew dhcp interface eth2

Same issue.

I don’t see the default route in my tests

vyos@r4:~$ show conf com | match eth2
set interfaces ethernet eth2 address 'dhcp'
set interfaces ethernet eth2 dhcp-options no-default-route
set interfaces ethernet eth2 hw-id '52:54:00:40:2e:af'
vyos@r4:~$ 
vyos@r4:~$ 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, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

C>* 192.0.2.0/24 is directly connected, eth1, 00:28:14
C>* 192.168.100.0/24 is directly connected, eth2, 00:00:15
C>* 192.168.122.0/24 is directly connected, eth0, 00:28:14
vyos@r4:~$ 
vyos@r4:~$ 
vyos@r4:~$ show ver
Version:          VyOS 1.5-rolling-202309170024

admin@vyos-ZJG:~$ show conf com | match eth2
set interfaces ethernet eth2 address 'dhcp'
set interfaces ethernet eth2 dhcp-options no-default-route
set interfaces ethernet eth2 hw-id '00:0c:29:69:28:86'
admin@vyos-ZJG:~$ 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, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

S>* 0.0.0.0/0 [210/0] via 13.44.255.254, eth2, weight 1, 00:15:35
S>* 12.74.160.0/20 [1/0] via 13.44.255.254, eth2, weight 1, 00:15:36
C>* 13.44.0.0/16 is directly connected, eth2, 00:15:36
O   100.100.104.0/24 [110/1] is directly connected, eth0, weight 1, 00:50:03
C>* 100.100.104.0/24 is directly connected, eth0, 00:50:06
O>* 172.18.10.0/24 [110/2] via 100.100.104.254, eth0, weight 1, 00:49:20
O>* 172.18.20.0/24 [110/2] via 100.100.104.254, eth0, weight 1, 00:49:20
O>* 172.18.30.0/24 [110/2] via 100.100.104.254, eth0, weight 1, 00:49:20
O>* 172.18.39.0/24 [110/2] via 100.100.104.254, eth0, weight 1, 00:49:20
O>* 172.18.50.0/24 [110/2] via 100.100.104.254, eth0, weight 1, 00:49:20
O>* 172.18.60.0/24 [110/2] via 100.100.104.254, eth0, weight 1, 00:49:20
O>* 172.18.61.0/24 [110/2] via 100.100.104.254, eth0, weight 1, 00:49:20
O>* 172.18.62.0/24 [110/2] via 100.100.104.254, eth0, weight 1, 00:49:20
O>* 172.18.88.0/24 [110/2] via 100.100.104.254, eth0, weight 1, 00:49:20
O>* 172.18.250.0/24 [110/2] via 100.100.104.254, eth0, weight 1, 00:49:20
admin@vyos-ZJG:~$ show ver
Version:          VyOS 1.5-rolling-202309170024
Release train:    current

Built by:         autobuild@vyos.net
Built on:         Sun 17 Sep 2023 01:47 UTC
Build UUID:       ba889739-2b8e-4de4-8bd9-10b665f66abb
Build commit ID:  2ca594db0d1fe2

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

Hardware vendor:  VMware, Inc.
Hardware model:   VMware20,1
Hardware S/N:     VMware-56 4d 19 be 27 7f 46 12-72 5b 2c 8c 5e 69 28 72
Hardware UUID:    be194d56-7f27-1246-725b-2c8c5e692872

Copyright:        VyOS maintainers and contributors

The tricky is try to add “static route 0.0.0.0/0 via eth2”, after commit, then del the “static route 0.0.0.0/0 via eth2”, the default route disaperaed.

I have the same problem with an older rolling release but only with one of the two interfaces getting address via DHCP. How to debug that?

Here is what I have found in the logs:

Nov 05 23:36:54 vyos dhclient-script-vyos[80658]: Converted vtysh command: "ip route x.x.x.0/32  eth0 tag 210 1 "
Nov 05 23:36:54 vyos dhclient-script-vyos[80658]: Sending command to vtysh
Nov 05 23:36:54 vyos dhclient-script-vyos[80658]: FRR status: running
Nov 05 23:36:54 vyos dhclient-script-vyos[80658]: Checking if the route presented in kernel: default via x.x.x.0 dev eth0 metric 1
Nov 05 23:36:54 vyos dhclient-script-vyos[80658]: Converted vtysh command: "ip route 0.0.0.0/0 x.x.x.0 eth0 tag 210 1 "
Nov 05 23:36:54 vyos dhclient-script-vyos[80658]: Sending command to vtysh

I have actually realized that option works for my back-up connection, but not for my main connection.

It looks like the dhcp client configuration is properly generated, removing the routes options. Here is the diff of the generate /var/lib/dhcp/dhclient_eth0.conf configuration file without and with the no-default-route in vyos:

<     request subnet-mask, broadcast-address, routers, domain-name-servers,
---
>     request subnet-mask, broadcast-address, domain-name-servers,

The issue is that the dhcp server seems to return anyway the routes:

vyos@vyos:/etc/dhcp/dhclient-exit-hooks.d$ cat /var/lib/dhcp/dhclient_eth0.lease | grep routers
new_routers='80.xxx.xxx.0'
old_routers='80.xxx.xxx.0'

As a comparison, here is the same for the bak-up connection (with the dhcp client configured in the same way as the main connection):

vyos@vyos:/etc/dhcp/dhclient-exit-hooks.d$ cat /var/lib/dhcp/dhclient_eth1.11.lease | grep routers
new_routers=''
old_routers=''

Is that a misbehavior of one of the two dhcp servers?