ensp配置DHCP

DHCP(动态主机配置协议)是一个局域网的网络协议。指的是由服务器控制一段IP地址范围,客户机登录服务器时就可以自动获得服务器分配的IP地址和子网掩码。

拓扑图

拓扑图

对R1进行配置

对GE 0/0/0 和GE 0/0/1分配ip

[Huawei]interface GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.1 24
Jul 19 2022 13:02:48-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
 IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[Huawei-GigabitEthernet0/0/0]q
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 172.16.1.1 24
Jul 19 2022 13:03:13-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
 IP on the interface GigabitEthernet0/0/1 has entered the UP state. 

配置DHCP

开启dhcp
[Huawei]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.

配置左边广播域的dhcp

创建一个地址池aa
[Huawei]ip pool aa
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-aa]
配置地址池的ip、网关、dns
[Huawei-ip-pool-aa]network 192.168.1.0 mask 24
[Huawei-ip-pool-aa]gateway-list 192.168.1.1
[Huawei-ip-pool-aa]dns-list 114.114.114.114 8.8.8.8
在接口中选择全局配置
[Huawei]interface GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0]dhcp select global 
返回用户视图模式,保存
<Huawei>save
  The current configuration will be written to the device. 
  Are you sure to continue? (y/n)[n]:y
  It will take several minutes to save configuration file, please wait.......
  Configuration file had been saved successfully
  Note: The configuration file will take effect after being activated
<Huawei>

测试

在pc1上选择使用dhcp获取ip地址
通过抓包工具,可以发现,dhcp获取ip配置成功
dhcp第一次获取
也可以在pc1的命令行输入ipconfig查看
在这里插入图片描述

同理,在pc2上选择使用dhcp获取ip地址

配置右边广播域的dhcp

右边的配置与左边类似
略…… (以下省略一千字)

对R1进行加密

创建两个用户,一个管理员用户admin(权限15),一个访客用户guest(权限0)

[Huawei]aaa
[Huawei-aaa]local-user admin privilege level 15 password cipher admin
[Huawei-aaa]local-user guest privilege level 0 password cipher guest
[Huawei-aaa]local-user admin service-type terminal 
[Huawei-aaa]local-user guest service-type terminal 

设置使用aaa认证模式登陆

[Huawei]user-interface console 0
[Huawei-ui-console0]authentication-mode aaa

测试

使用admin登陆
在这里插入图片描述

使用
guest登陆
在这里插入图片描述

  • 7
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值