DHCP实验配置

例图:

 要求:

1.DHCP Server0/0/0口使用接口DHCP进行分配IP

2.DHCP Server0/0/1口使用全局DHCP进行分配IP

3.各pc间均可分配IP

思路:

   1.需要先配置路由器在0/0/0接口的ip地址,再激活接口地址池,然后配置接口地址池中的DNS,最后配置PC1,PC2的IP

   2.需要先配置路由器在0/0/1接口的ip地址,启动DHCP协议,然后创建全局地址池,配置可分配的IP,然后配置网关信息配置DNS,最后配置PC3,PC4的IP

配置:

激活接口地址池

[Huawei]sysname AR1
[AR1]inter	
[AR1]interface g	
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]ip a	
[AR1-GigabitEthernet0/0/0]ip accounting
[AR1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
Apr 18 2023 21:17:54-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[AR1-GigabitEthernet0/0/0]quit
[AR1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[AR1]in	
[AR1]info-center
[AR1]interface g	
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]dhcp select interface
[AR1-GigabitEthernet0/0/0]dhcp server dns-list 1.2.3.4

分配IP:

PC1:

PC>ipconfig

Link local IPv6 address...........: fe80::5689:98ff:fe26:64da
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.1.1
Physical address..................: 54-89-98-26-64-DA
DNS server........................: 1.2.3.4


PC2:

PC>ipconfig

Link local IPv6 address...........: fe80::5689:98ff:fe72:68e9
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.1.1
Physical address..................: 54-89-98-72-68-E9
DNS server........................: 1.2.3.4


启动DHCP协议:

[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ip ad	
[AR1-GigabitEthernet0/0/1]ip address 192.168.2.1 24
Apr 18 2023 21:25:00-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[AR1-GigabitEthernet0/0/1]quit
[AR1]dhcp enable

创建全局地址池,配置可分配的IP:

[AR1]ip pool 114514
Info: It's successful to create an IP address pool.
[AR1-ip-pool-114514]network 192.168.2.0 mask 24
[AR1-ip-pool-114514]gateway-list 192.168.2.1
[AR1-ip-pool-114514]dns-list 8.8.8.8 114.114.114.114

分配IP:

PC3:

PC>ipconfig

Link local IPv6 address...........: fe80::5689:98ff:fef1:4db8
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.2.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.2.1
Physical address..................: 54-89-98-F1-4D-B8
DNS server........................: 8.8.8.8
                                    114.114.114.114

PC4:

PC>ipconfig

Link local IPv6 address...........: fe80::5689:98ff:fed9:718d
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.2.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.2.1
Physical address..................: 54-89-98-D9-71-8D
DNS server........................: 8.8.8.8
                                    114.114.114.114

PC1 ping通 PC3:

PC1:

PC>ping 192.168.2.254

Ping 192.168.2.254: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.254: bytes=32 seq=2 ttl=127 time=78 ms
From 192.168.2.254: bytes=32 seq=3 ttl=127 time=78 ms
From 192.168.2.254: bytes=32 seq=4 ttl=127 time=63 ms
From 192.168.2.254: bytes=32 seq=5 ttl=127 time=78 ms

--- 192.168.2.254 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/74/78 ms

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值