Topology
configuration
router ( dhcp server) configuration
enable dhcp
dhcp enable
Configure dhcp address pool
#
dhcp server ip-pool vlan10
gateway-list 192.168.10.1//configure gateway address
network 192.168.10.0 mask 255.255.255.0//configure dhcp network segment
dns - list 114.114.114.114//Configure dns server address
expired day 0 hour 10// Configure the lease period
forbidden-ip 192.168.10.1//configure exclusion address
#
Configure router interface address
interface GigabitEthernet0/0
ip address 192.168.0.1 255.255.255.0
#
Configure a static route from the dhcp server to the intranet 192.168.10.0/24 to ensure network connectivity
ip route-static 192.168.10.0 24 192.168.0.2
switch configuration
enable dhcp
dhcp enable
interface Vlan-interface10
ip address 192.168.10.1 255.255.255.0
dhcp select relay// Set the interface to work in dhcp relay mode
dhcp relay server-address 192.168.0.1\\ Set the address of the dhcp server of the interface relay
#
interface Vlan-interface100
ip address 192.168.0.2 255.255.255.0
Add a default static route to ensure network communication with the dhcp server
ip route-static 0.0.0.0 0 192.168.0.1
Check the dhcp allocation on the router of the dhcp server
display dhcp server ip-in-use
Run the command to check the statistics of the dhcp server. display dhcp server statistics
Select the PC , right-click configuration, enable interface management, select DHCP for IPV4 configuration , click Enable, and then refresh to display the status of the IPV4 address