DHCP
Switch(config)# ip dhcp excluded-address <first IP address> <last IP address>
Switch(config)# ip dhcp pool <pool name>
Switch(dhcp-config)# network <network IP address> { /<prefix length> | <network mask> }
Switch(dhcp-config)# dns-server <DNS> [...]
Switch(dhcp-config)# default-router <gateway>
Example
Switch(config)# ip dhcp excluded-address 10.0.0.1 10.0.0.100
Switch(config)# ip dhcp pool Office
Switch(dhcp-config)# network 10.0.0.0 /24
Switch(dhcp-config)# dns-server 1.1.1.1 8.8.8.8
Switch(dhcp-config)# default-router 10.0.0.1
Preassigning IP Addresses
- Method 1
Switch(dhcp-config)# address <IP> { client-id <ID> | hardware-address <MAC address> }
- Method 2
Switch(config)# ip dhcp pool <pool name>
Switch(dhcp-config)# host <IP> [ /<prefix length> | <network mask> ]
Switch(dhcp-config)# client-identifier <ID>
Switch(dhcp-config)# hardware-address <MAC address>
Verify DHCP
Switch# show ip dhcp binding
Switch# show ip dhcp conflict
DHCP snooping
Drop DHCP on untrust interface
Switch(config)# ip dhcp snooping
Switch(config)# ip dhcp snooping vlan <VLAN list>
Switch(config)# no ip dhcp snooping information option
Trust DHCP from this port
Switch(config-if)# ip dhcp snooping trust