eNSP华为模拟器-DHCP配置

拓扑图

要求

  • PC1通过DHCP获取192.168.1.1地址
  • PC2和PC3通过DHCP地址池方式获取IP地址
  • 配置静态路由使其ping通

配置

配置主机名及接口IP地址

#    AR1
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys AR1
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
May 27 2024 14:32:56-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]int g0/0/1
[AR1-GigabitEthernet0/0/1]ip add 10.1.12.1 24
May 27 2024 14:33:06-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]
#    AR2
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys AR2
[AR2]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip add 10.1.12.2 24
May 27 2024 14:33:55-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[AR2-GigabitEthernet0/0/1]int g0/0/0
[AR2-GigabitEthernet0/0/0]ip add 172.16.1.254 24
May 27 2024 14:34:04-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[AR2-GigabitEthernet0/0/0]

配置DHCP

#    AR1
[AR1]ip pool 1        //创建ip地址池,后跟地址池名称
Info: It's successful to create an IP address pool.
[AR1-ip-pool-1]network 192.168.1.0 mask 24    //dhcp分配的网络及其掩码
[AR1-ip-pool-1]gateway-list 192.168.1.254     //dhcp分配的网关地址
[AR1-ip-pool-1]static-bind ip-address 192.168.1.1 mac-address 5489-9838-24A8    //配置静态ip地址分配,后跟PC的MAC地址
[AR1-ip-pool-1]q
[AR1]dhcp enable    //开启dhcp服务
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]dhcp select global    //将dhcp应用到全局接口
#    AR2
<AR2>sys
Enter system view, return user view with Ctrl+Z.
[AR2]ip pool 1
Info: It's successful to create an IP address pool.
[AR2-ip-pool-1]network 172.16.1.0 mask 24
[AR2-ip-pool-1]gateway-list 172.16.1.254
[AR2-ip-pool-1]q
[AR2]dhcp enable
[AR2]int g0/0/0
[AR2-GigabitEthernet0/0/0]dhcp select global

配置静态路由

#    AR1
[AR1]ip route-static 172.16.1.0 24 10.1.12.2
#    AR2
[AR2]ip route-static 192.168.1.0 24 10.1.12.1

测试

获取PC1的IP地址

PC2

PC3

ping测试

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

拾柒SHY

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值