clear dhcp-server leases

Syntax

clear dhcp-server leases [all-vrfs | <IPV4-ADDR> vrf <VRF-NAME>] | vrf <VRF-NAME>]

Description

Clears DHCPv4 server lease information. The DHCPv4 server must be disabled before clearing lease information.

Command context

Manager (#)

Parameters

all-vrfs

Clears leases for all VRFs.

<IPV4-ADDR> vrf <VRF-NAME>

Clears the lease for a specific client on a specific VRF. Specify the client address in IPv4 format (x.x.x.x), where x is a decimal number from 0 to 255. You can remove leading zeros. For example, the address 192.169.005.100 becomes 192.168.5.100.

vrf <VRF-NAME>

Clears leases for a specific VRF.

Authority

Operators or Administrators or local user group members with execution rights for this command. Operators can execute this command from the operator context (>) only.

Examples

Clearing all DHCPv4 server leases.

switch(config)# dhcp-server vrf primary
switch(config-dhcp-server)# disable
switch(config-dhcp-server)# exit
switch(config)# exit
switch# clear dhcp-server leases

Clearing all DHCPv4 server leases for VRF primary-vrf.

switch(config)# dhcp-server vrf primary
switch(config-dhcp-server)# disable
switch(config-dhcp-server)# exit
switch(config)# exit
switch# clear dhcp-server leases vrf primary-vrf

Clear the DHCPv4 server lease for IP address 10.10.10.1 on VRF primary-vrf.

switch(config)# dhcp-server vrf primary
switch(config-dhcp-server)# disable
switch(config-dhcp-server)# exit
switch(config)# exit
switch# clear dhcp-server leases 10.10.10.1 vrf primary-vrf