1、拓扑图
2、需求分析
DHCP Server0/0/0口使用接口DHCP进行分配IP
DHCP Server0/0/1口使用全局DHCP进行分配IP
各PC间均可互通
3、所有配置内容
路由器操作如下:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname DHCF Server
[DHCF Server]interface GigabitEthernet 0/0/0
[DHCF Server-GigabitEthernet0/0/0]ip address 192.168.1.1 24
Apr 19 2023 14:49:58-08:00 DHCF Server %%01IFNET/4/LINK_STATE(l)[2]:The line pro
tocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[DHCF Server-GigabitEthernet0/0/0]q
[DHCF Server]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[DHCF Server]interface GigabitEthernet 0/0/0
[DHCF Server-GigabitEthernet0/0/0]dhcp select interface
[DHCF Server-GigabitEthernet0/0/0]dhcp server dns-list 1.2.3.4
[DHCF Server-GigabitEthernet0/0/0]q
[DHCF Server]interface GigabitEthernet 0/0/1
[DHCF Server-GigabitEthernet0/0/1]ip address 192.168.2.1 24
Apr 19 2023 14:53:18-08:00 DHCF Server %%01IFNET/4/LINK_STATE(l)[3]:The line pro
tocol IP on the interface GigabitEthernet0/0/1 has entered the UP state.
[DHCF Server-GigabitEthernet0/0/1]dhcp enable
[DHCF Server]ip pool 123456789a
Info: It's successful to create an IP address pool.
[DHCF Server-ip-pool-123456789a]network 192.168.2.0 mask 24
[DHCF Server-ip-pool-123456789a]gateway-list 192.168.2.1
[DHCF Server-ip-pool-123456789a]dns-list 8.8.8.8 114.114.114.114
[DHCF Server-ip-pool-123456789a]q
[DHCF Server]interface GigabitEthernet 0/0/1
[DHCF Server-GigabitEthernet0/0/1]dhcp select global
[DHCF Server-GigabitEthernet0/0/1]q
PC1-4的IP进行DHCP应用;命令行输入ipconfig获取ip
PC1/2与PC3/4随机连接(ping ip地址)
4、测试结果