range
Syntax
range [prefix-len ] no range [prefix-len ]
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.
Theno
form of this command deletes the address range for the current pool.
Command context
config-dhcp-server-pool
Parameters
-
-
Specifies the lowest IP address in the pool in IPv4 format (
x.x.x.x
), wherex
is a decimal number from 0 to 255. -
-
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
-
Specifies the number of bits in the address mask in CIDR format (
x
), wherex
是一个十进制的数字从0到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/16switch(config-if-vlan)#active-gateway ip 200.1.1.3 mac 00:aa:aa:aa:aa:aaswitch(config-if-vlan)#exitswitch(config)#dhcp-server vrf primaryswitch(config-dhcp-server)#pool primary-poolswitch(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 range192.168.1.1to192.168.1.100with a mask of24bits for the DHCPv4 server poolprimary-poolon VRFprimary.
switch(config)#dhcp-server vrf primaryswitch(config-dhcp-server)#pool primary-poolswitch(config-dhcp-server-pool)#192.168.1.1 192.168.1.100 prefix-len 24
Deletes the address range192.168.1.1to192.168.1.100with a mask of24位从DHCPv4 server poolprimary-poolon VRFprimary.
switch(config)#dhcp-server vrf primaryswitch(config-dhcp-server)#pool primary-poolswitch(config-dhcp-server-pool)#no 192.168.1.1 192.168.1.100 prefix-len 24