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