HCL 配置 三 DHCP 配置
自动分配 IP 地址
一、任务
在实验二的基础上(VLAN10、20、30、40内的主机之间互ping成功)实现用 DHCP 给各 vlan 内主机自动分配地址
二、配置
由于在上一个实验的基础上,因此只需要配置四个PC和最上面的交换机S0即可
1、四个 PC
使用 DHCP,启用接口
2、最上面的交换机 S0
配置 DHCP
<LwS0>sys
System View: return to User View with Ctrl+Z.
[LwS0]dhcp enable
[LwS0]dhcp server ip-pool vlan10
[LwS0-dhcp-pool-vlan10]network 192.168.10.1 mask 255.255.255.0
[LwS0-dhcp-pool-vlan10]gateway-list 192.168.10.1
[LwS0-dhcp-pool-vlan10]qui
[LwS0]dhcp server ip-pool vlan20
[LwS0-dhcp-pool-vlan20]network 192.168.20.1 mask 255.255.255.0
[LwS0-dhcp-pool-vlan20]gateway-list 192.168.20.1
[LwS0-dhcp-pool-vlan20]quit
[LwS0]dhcp server ip-pool vlan30
[LwS0-dhcp-pool-vlan30]network 192.168.30.1 mask 255.255.255.0
[LwS0-dhcp-pool-vlan30]gateway-list 192.168.30.1
[LwS0-dhcp-pool-vlan30]quit
[LwS0]dhcp server ip-pool vlan40
[LwS0-dhcp-pool-vlan40]network 192.168.40.1 mask 255.255.255.0
[LwS0-dhcp-pool-vlan40]gateway-list 192.168.40.1
[LwS0-dhcp-pool-vlan40]quit
保存配置
[LwS0]quit
<LwS0>save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[flash:/startup.cfg]
(To leave the existing filename unchanged, press the enter key):
flash:/startup.cfg exists, overwrite? [Y/N]:y
Validating file. Please wait...
Saved the current configuration to mainboard device successfully.
三、测试
查看各个 PC 的 ip
然后 ping 另一台 PC,能 ping 通即可
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论