Dear Team:
Something is happening to me with the DHCP server, I have a VyOS (VyOS 1.5-rolling-202403050022) in which I have a LAN and a DMZ, and I have a DHCP server pool for each network.
set service dhcp-server shared-network-name DMZ subnet 10.10.60.0/24 lease '86400'
set service dhcp-server shared-network-name DMZ subnet 10.10.60.0/24 option default-router '10.10.60.1'
set service dhcp-server shared-network-name DMZ subnet 10.10.60.0/24 option domain-name 'vyos.net'
set service dhcp-server shared-network-name DMZ subnet 10.10.60.0/24 option name-server '8.8.8.8'
set service dhcp-server shared-network-name DMZ subnet 10.10.60.0/24 range 0 start '10.10.60.100'
set service dhcp-server shared-network-name DMZ subnet 10.10.60.0/24 range 0 stop '10.10.60.200'
set service dhcp-server shared-network-name DMZ subnet 10.10.60.0/24 subnet-id '2'
set service dhcp-server shared-network-name LAN subnet 192.168.60.0/24 lease '86400'
set service dhcp-server shared-network-name LAN subnet 192.168.60.0/24 option default-router '192.168.60.1'
set service dhcp-server shared-network-name LAN subnet 192.168.60.0/24 option domain-name 'vyos.net'
set service dhcp-server shared-network-name LAN subnet 192.168.60.0/24 option name-server '8.8.8.8'
set service dhcp-server shared-network-name LAN subnet 192.168.60.0/24 range 0 start '192.168.60.100'
set service dhcp-server shared-network-name LAN subnet 192.168.60.0/24 range 0 stop '192.168.60.200'
set service dhcp-server shared-network-name LAN subnet 192.168.60.0/24 subnet-id '1'
I connected the same PC yesterday, first to the LAN and then to the DMZ. It gave me an IP address on both networks and worked. I turned off the router, turned it on today, and reconnected the PC, but it didn’t give me an IP address. When I look at the DHCP leases, I see yesterday’s:
vyos@vyos# run show dhcp server leases
IP Address MAC address State Lease start Lease expiration Remaining Pool Hostname Origin
-------------- ----------------- ------- ------------------- ------------------- ----------- ------ ---------- --------
10.10.60.100 40:6c:8f:58:99:ee active 2025/05/28 11:40:09 2025/05/29 11:40:09 23:42:17 DMZ ubuntu local
192.168.60.100 40:6c:8f:58:99:ee active 2025/05/27 15:00:03 2025/05/28 15:00:03 3:02:11 LAN ubuntu local
[edit]
vyos@vyos#
I tried to delete them with the command “clear dhcp-server lease ip” and I got an error, it doesn’t delete them:
vyos@vyos:~$ clear dhcp-server lease ip
Traceback (most recent call last):
File "/usr/libexec/vyos/op_mode/clear_dhcp_lease.py", line 22, in <module>
from vyos.kea import kea_parse_leases
ImportError: cannot import name 'kea_parse_leases' from 'vyos.kea' (/usr/lib/python3/dist-packages/vyos/kea.py)
vyos@vyos:~$
Disconnect the PC, delete the configuration of both DHCP pools and the leases disappear:
vyos@vyos# delete service dhcp-server shared-network-name DMZ
[edit]
vyos@vyos# delete service dhcp-server shared-network-name LAN
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# save
[edit]
vyos@vyos#
vyos@vyos# run show dhcp server leases
WARNING: DHCP server is configured but not started. Data may be stale.
IP Address MAC address State Lease start Lease expiration Remaining Pool Hostname Origin
------------ ------------- ------- ------------- ------------------ ----------- ------ ---------- --------
[edit]
vyos@vyos#
I reconfigured them without connecting any PC, I did a show and the old leases were still there, this is the strange thing, they don’t disappear:
vyos@vyos# run show dhcp server leases
IP Address MAC address State Lease start Lease expiration Remaining Pool Hostname Origin
-------------- ----------------- ------- ------------------- ------------------- ----------- ------ ---------- --------
10.10.60.100 40:6c:8f:58:99:ee active 2025/05/28 11:40:09 2025/05/29 11:40:09 23:42:17 DMZ ubuntu local
192.168.60.100 40:6c:8f:58:99:ee active 2025/05/27 15:00:03 2025/05/28 15:00:03 3:02:11 LAN ubuntu local
[edit]
vyos@vyos#
Does anyone know if this is a bug? Is there a way to fix it? I’m assuming it will release them when the “Remaining” column time runs out, but is there a way to do it manually with a command?
Thank you very much in advance,