Page MenuHomeVyOS Platform

DHCP Lease not displayed with a static map
Confirmed, NormalPublicBUG

Description

When we use static mapping for DHCP-server, it not display the lease.
Server side:

set service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 default-router '10.0.0.1'
set service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 dns-server '10.0.0.1'
set service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 lease '86400'
set service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 range 0 start '10.0.0.100'
set service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 range 0 stop '10.0.0.199'
set service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 static-mapping myPC ip-address '10.0.0.130'
set service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 static-mapping myPC mac-address '52:54:00:a9:98:2c'

Show leases:

vyos@r1-roll:~$ show dhcp server leases 
IP address    Hardware address    State    Lease start    Lease expiration    Remaining    Pool    Hostname
------------  ------------------  -------  -------------  ------------------  -----------  ------  ----------
vyos@r1-roll:~$

R2 client side

vyos@r2-roll# run show int | match eth1
eth1             10.0.0.130/24                     u/u

Delete static mapping:

vyos@r1-roll# delete service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 static-mapping myPC 
[edit]
vyos@r1-roll# commit

Reassign ip on the client-side:

delete interfaces ethernet eth1 address dhcp 
commit

set interfaces ethernet eth1 address dhcp
commit

vyos@r2-roll# run show int | match eth1
eth1             10.0.0.130/24                     u/u 
[edit]
vyos@r2-roll#

Chek leases on the server side:

vyos@r1-roll# run show dhcp server leases 
IP address    Hardware address    State    Lease start          Lease expiration     Remaining    Pool    Hostname
------------  ------------------  -------  -------------------  -------------------  -----------  ------  ----------
10.0.0.130    52:54:00:a9:98:2c   active   2020/07/27 15:42:17  2020/07/28 15:42:17  23:58:56     LAN     r2-roll

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.3-rolling-202007270117
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)

Event Timeline

It's a known limitation of the ISC DHCPD. It treats static leases completely differently from dynamic ones.

Tested in VyOS 1.4-rolling-202311100309:
Configurations:

set interfaces ethernet eth0 address '10.0.0.130/24'

set service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 default-router '10.0.0.1'
set service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 lease '86400'
set service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 name-server '10.0.0.1'
set service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 range 0 start '10.0.0.100'
set service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 range 0 stop '10.0.0.199'
set service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 static-mapping myPC ip-address '10.0.0.110'
set service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 static-mapping myPC mac-address '00:50:79:66:68:00'

Behavior is the same:

sh dhcp server leases
IP Address    MAC address    State    Lease start    Lease expiration    Remaining    Pool    Hostname
------------  -------------  -------  -------------  ------------------  -----------  ------  ----------

Deleting the static mapping:

delete service dhcp-server shared-network-name LAN subnet 10.0.0.0/24 static-mapping myPC
commit

Reassigning the IP to the PC (client).
Checking on the VyOS side:

show dhcp server leases
IP Address    MAC address        State    Lease start          Lease expiration     Remaining    Pool    Hostname
------------  -----------------  -------  -------------------  -------------------  -----------  ------  ----------
10.0.0.100    00:50:79:66:68:00  active   2023/11/20 06:24:37  2023/11/21 06:24:37  23:59:26     LAN     PC1

After the deletion of the static mapping, VyOS shows the leases

n.fort changed the task status from Open to In progress.Nov 28 2023, 2:51 PM
n.fort added a project: VyOS 1.5 Circinus.
n.fort set Issue type to Unspecified (please specify).
n.fort changed the task status from In progress to Confirmed.Nov 28 2023, 5:03 PM
dmbaturin triaged this task as Normal priority.Jan 9 2024, 5:02 PM

It all works in Kea now, right? Can we close the task?