range
Syntax
range <LOW-IPV4-ADDR> <HIGH-IPV4-ADDR> [prefix-len <MASK>]
no range <LOW-IPV4-ADDR> <HIGH-IPV4-ADDR> [prefix-len <MASK>]
Description
Defines the range of IP addresses supported by the current DHCPv4 server pool. A maximum of 64 ranges are supported per switch across all VRFs.
The
no
form of this command deletes the address range for the current pool.
Command context
config-dhcp-server-pool
Parameters
<LOW-IPV4-ADDR>
Specifies the lowest IP address in the pool in IPv4 format (
x.x.x.x
), wherex
is a decimal number from 0 to 255.<HIGH-IPV4-ADDR>
Specifies the highest IP address in the pool in IPv4 format (
x.x.x.x
), wherex
is a decimal number from 0 to 255.prefix-len <MASK>
Specifies the number of bits in the address mask in CIDR format (
x
), wherex
is a decimal number from 0 to 32.NOTE:When active gateway is configured on the interface serviced by the pool, you must specify a prefix length that matches the mask on the IP address assigned to the interface. Otherwise, client stations will get a prefix length from active gateway that may not be consistent with the configured range, and a DHCP error will occur. In the following example, the DHCP range prefix is set to 16 to match the mask on the IP address assigned to interface VLAN 2.
switch(config)# interface vlan 2 switch(config-if-vlan)# ip address 200.1.1.1/16 switch(config-if-vlan)# active-gateway ip 200.1.1.3 mac 00:aa:aa:aa:aa:aa switch(config-if-vlan)# exit switch(config)# dhcp-server vrf primary switch(config-dhcp-server)# pool primary-pool switch(config-dhcp-server-pool)# range 192.168.1.1 192.168.1.100 prefix-len 16
Authority
Administrators or local user group members with execution rights for this command.
Example
Defines the address range 192.168.1.1 to 192.168.1.100 with a mask of 24 bits for the DHCPv4 server pool primary-pool on VRF primary.
switch(config)# dhcp-server vrf primary switch(config-dhcp-server)# pool primary-pool switch(config-dhcp-server-pool)# 192.168.1.1 192.168.1.100 prefix-len 24
Deletes the address range 192.168.1.1 to 192.168.1.100 with a mask of 24 bits from the DHCPv4 server pool primary-pool on VRF primary.
switch(config)# dhcp-server vrf primary switch(config-dhcp-server)# pool primary-pool switch(config-dhcp-server-pool)# no 192.168.1.1 192.168.1.100 prefix-len 24