400
Configuring DHCP
How to Configure DHCP
Enabling DHCP Server Port-Based Address Allocation
Preassigning an IP Address
After enabling DHCP port-based address allocation on the switch, use the ip dhcp pool global configuration command
to preassign IP addresses and to associate them to clients. To restrict assignments from the DHCP pool to preconfigured
reservations, you can enter the reserved-only DHCP pool configuration command. Unreserved addresses that are part
of the network or on pool ranges are not offered to the client, and other clients are not served by the pool. By entering
this command, users can configure a group of switches with DHCP pools that share a common IP subnet and that ignore
requests from clients of other switches.
4. ip dhcp snooping database
write-delay seconds
Specifies the duration for which the transfer should be delayed after the
binding database changes. The range is from 15 to 86400 seconds. The
default is 300 seconds (5 minutes).
5. end Returns to privileged EXEC mode.
6. ip dhcp snooping binding mac-address
vlan vlan-id ip-address interface
interface-id expiry seconds
(Optional) Adds binding entries to the DHCP snooping binding database.
The vlan-id range is from 1 to 4904. The seconds range is from
1 to 4294967295.
Enter this command for each entry that you add.
Note: Use this command when you are testing or debugging the switch.
Command Purpose
Command Purpose
1. configure terminal Enters global configuration mode.
2. ip dhcp use subscriber-id client-id Configures the DHCP server to globally use the
subscriber identifier as the client identifier on all
incoming DHCP messages.
3. ip dhcp subscriber-id interface-name Automatically generates a subscriber identifier
based on the short name of the interface.
A subscriber identifier configured on a specific
interface takes precedence over this command.
4. interface interface-id Specifies the interface to be configured, and enters
interface configuration mode.
5. ip dhcp server use subscriber-id client-id Configures the DHCP server to use the subscriber
identifier as the client identifier on all incoming DHCP
messages on the interface.
6. end Returns to privileged EXEC mode.
Command Purpose
1. configure terminal Enters global configuration mode.
2. ip dhcp pool poolname Enters DHCP pool configuration mode, and defines
the name for the DHCP pool. The pool name can be
a symbolic string (such as Engineering) or an integer
(such as 0).
3. network network-number [mask | /prefix-length] Specifies the subnet network number and mask of
the DHCP address pool.