Sometimes, we need to release IP addresses manually from the lease database. This feature would allow us to perform lease releases directly via the op-mode command.
Lab Diagram:
Configurations:
set system host-name dhcp-srv-01 set interfaces ethernet eth0 address 192.0.2.1/24 set interfaces ethernet eth1 address 192.168.1.1/24 set high-availability vrrp group public hello-source-address '192.168.1.1' set high-availability vrrp group public interface 'eth1' set high-availability vrrp group public peer-address '192.168.1.2' set high-availability vrrp group public no-preempt set high-availability vrrp group public priority '200' set high-availability vrrp group public address '192.168.1.254/24' set high-availability vrrp group public vrid '11' set service dhcp-server shared-network-name NET-VYOS subnet 192.168.1.0/24 default-router '192.168.1.254' set service dhcp-server shared-network-name NET-VYOS subnet 192.168.1.0/24 name-server '192.168.1.254' set service dhcp-server shared-network-name NET-VYOS subnet 192.168.1.0/24 domain-name 'vyos.net' set service dhcp-server shared-network-name NET-VYOS subnet 192.168.1.0/24 range 0 start '192.168.1.10' set service dhcp-server shared-network-name NET-VYOS subnet 192.168.1.0/24 range 0 stop '192.168.1.250' set service dhcp-server shared-network-name NET-VYOS subnet 192.168.1.0/24 enable-failover set service dhcp-server high-availability source-address '192.168.1.1' set service dhcp-server high-availability name 'NET-VYOS' set service dhcp-server high-availability remote '192.168.1.2' set service dhcp-server high-availability status 'primary'
set system host-name dhcp-srv-02 set interfaces ethernet eth0 address 192.0.2.2/24 set interfaces ethernet eth1 address 192.168.1.2/24 set high-availability vrrp group public hello-source-address '192.168.1.2' set high-availability vrrp group public interface 'eth1' set high-availability vrrp group public peer-address '192.168.1.1' set high-availability vrrp group public no-preempt set high-availability vrrp group public priority '100' set high-availability vrrp group public address '192.168.1.254/24' set high-availability vrrp group public vrid '11' set service dhcp-server shared-network-name NET-VYOS subnet 192.168.1.0/24 default-router '192.168.1.254' set service dhcp-server shared-network-name NET-VYOS subnet 192.168.1.0/24 name-server '192.168.1.254' set service dhcp-server shared-network-name NET-VYOS subnet 192.168.1.0/24 domain-name 'vyos.net' set service dhcp-server shared-network-name NET-VYOS subnet 192.168.1.0/24 range 0 start '192.168.1.10' set service dhcp-server shared-network-name NET-VYOS subnet 192.168.1.0/24 range 0 stop '192.168.1.250' set service dhcp-server shared-network-name NET-VYOS subnet 192.168.1.0/24 enable-failover set service dhcp-server high-availability source-address '192.168.1.2' set service dhcp-server high-availability name 'NET-VYOS' set service dhcp-server high-availability remote '192.168.1.1' set service dhcp-server high-availability status 'secondary'
Suggested Command Syntax
The following op-mode command needs to be introduced to accomplish this task:
release dhcp server <IP address>
Example:
release dhcp server 192.168.1.10