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