Flush DHCP server lease(s) HOWTO

Hi,
We have issues with the DHCP server config, we can’t find a way to clear existing lease(s).

The DHCP server itself works fine, it hands out the ip’s gateway and DNS stuff, all good.
But what if we need to clear a DHCP lease, we can’t find any command that is in the docs’ or command line, what should the command that wil work ?
Many thanx in advance !

ps current config below:
set service dhcp-server shared-network-name WAN1-DHCP authoritative

set service dhcp-server shared-network-name WAN1-DHCP subnet 10.10.10.0/29 default-router ‘10.10.10.1’

set service dhcp-server shared-network-name WAN1-DHCP subnet 10.10.10.0/29 dns-server ‘8.8.8.8’

set service dhcp-server shared-network-name WAN1-DHCP subnet 10.10.10.0/29 dns-server ‘8.8.4.4’

set service dhcp-server shared-network-name WAN1-DHCP subnet 10.10.10.0/29 lease ‘86300’

ge 1 start ‘10.10.10.2’

set service dhcp-server shared-network-name WAN1-DHCP subnet 10.10.10.0/29 range 1 stop ‘10.10.10.5’

There is currently no operational level command that I’m aware of to handle this situation. But according to the documents this can be done using the /usr/bin/omshell binary.

If you could help us handle this in an interactive way we can most certainly deploy a CLI command for it.

I created a feature request here: https://phabricator.vyos.net/T3144

1 Like

Hi, thank you for fast reply.
Please let me know how i can support this from my side,
What i can find is that the commands existed for vyatta, meaning:
Clear a specific lease on a server
Clear all leases on a server

As another solution, you can use the IPOE server. ipoe
And reset sessions

vyos@r5-roll:~$ reset ipoe-server session 
Possible completions:
  interface     Clear ipoe-server session by interface
  sid           Clear ipoe-server session by Session ID
  username      Clear ipoe-server session by username

I am sorry, but I am still confused on the workflow here.

If I have a host I want to give a static lease, I configure a static lease in the dhcp service configuration, commit, and then wait ~24 hours for the lease to be renewed to the static lease?

Is there a way to invalidate the old lease and get the new lease to apply right now?

Dhcp doesn’t allow you to handle client lease because it doesn’t use any p2p connectivity like pppoe session which you can terminate.
You can’t to send from server site any other packet, to force renew client site, it’s protocol implementation.

Some of what you want in IPOE server.