本文共 2381 字,大约阅读时间需要 7 分钟。
1.建拓扑图如下
2.修改名称DHCP[Huawei]sysname DHCP接口配置ip[DHCP]interface GigabitEthernet 0/0/0[DHCP-GigabitEthernet0/0/0]ip address 192.168.1.254 243.配置DHCP
启用DHCP服务[DHCP]dhcp enable 配置DHCP模式[DHCP-GigabitEthernet0/0/0]dhcp select interface4.测试
PC>ipconfigLink local IPv6 address...........: fe80::5689:98ff:fe1b:4a1a
IPv6 address......................: :: / 128IPv6 gateway......................: ::IPv4 address......................: 192.168.1.253Subnet mask.......................: 255.255.255.0Gateway...........................: 192.168.1.254Physical address..................: 54-89-98-1B-4A-1ADNS server........................:5.配置dns、并测试
[DHCP-GigabitEthernet0/0/0]dhcp server dns-list 8.8.8.8PC>ipconfig /renew
IP Configuration
Link local IPv6 address...........: fe80::5689:98ff:fe1b:4a1a
IPv6 address......................: :: / 128IPv6 gateway......................: ::IPv4 address......................: 192.168.1.253Subnet mask.......................: 255.255.255.0Gateway...........................: 192.168.1.254Physical address..................: 54-89-98-1B-4A-1ADNS server........................: 8.8.8.86.配置DHCP地址排除、并测试
[DHCP-GigabitEthernet0/0/0]dhcp server excluded-ip-address 192.168.1.201 192.168.1.252PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe11:5ef5
IPv6 address......................: :: / 128IPv6 gateway......................: ::IPv4 address......................: 192.168.1.200Subnet mask.......................: 255.255.255.0Gateway...........................: 192.168.1.254Physical address..................: 54-89-98-11-5E-F5DNS server........................: 8.8.8.87.配置地址租期
[DHCP-GigabitEthernet0/0/0]dhcp server lease day 78.查看dhcp地址使用情况
Start End Total Used Idle(Expired) Conflict Disable
192.168.1.1 192.168.1.254 253 2 199(0) 0 52
199 192.168.1.200 5489-9811-5ef5 203 Used 252 192.168.1.253 5489-981b-4a1a 425 Used
转载于:https://blog.51cto.com/11806823/2069567