H3C三层交换机配置DHCP
1、建立vlan ,配置vlan接口
[SW01]vlan 11
[SW01-vlan11]port GigabitEthernet 1/0/1 #将端口加入vlan
[SW01-vlan11]vlan 22
[SW01-vlan22]port GigabitEthernet 1/0/2
[SW01-vlan22]quit
[SW01]interface Vlan-interface 11 #进入vlan接口
[SW01-Vlan-interface11]ip address 192.168.1.254 24 #配置vlan接口的ip和mask
[SW01-Vlan-interface11]interface Vlan-interface 22
[SW01-Vlan-interface22]ip address 192.168.2.254 24
[SW01-Vlan-interface22]quit
2、配置DHCP地址池
[SW01]dhcp enable # 启动dhcp服务
[SW01]dhcp server forbidden-ip 192.168.1.254 #保留地址
[SW01]dhcp server forbidden-ip 192.168.2.254
#配置第一个地址池
[SW01]dhcp server ip-pool 4vlan11 #建立dhcp地址池
[SW01-dhcp-pool-4vlan11]network 192.168.1.0 24 #配置网络段和mask
[SW01-dhcp-pool-4vlan11]gateway-list 192.168.1.254 #配置虚拟网关
#[SW01-dhcp-pool-4vlan11]dns-list 8.8.8.8 #配置dns,实验环境未作配置
[SW01-dhcp-pool-4vlan11]address range 192.168.1.10 192.168.1.20 #划定地址池的范围
#配置第二个地址池
[SW01]dhcp server ip-pool 4vlan22
[SW01-dhcp-pool-4vlan22]network 192.168.2.0 24
[SW01-dhcp-pool-4vlan22]gateway-list 192.168.2.254
#[SW01-dhcp-pool-4vlan11]dns-list 8.8.8.8
[SW01-dhcp-pool-4vlan22]address range 192.168.2.10 192.168.2.20
3、将vlan接口和dhcp地址池连接
[SW01]interface Vlan-interface 11 #进入vlan接口
[SW01-Vlan-interface11]dhcp server apply ip-pool 4vlan11 #选择dhcp服务应用地址池4vlan11
[SW01-Vlan-interface11]interface Vlan-interface 22
[SW01-Vlan-interface22]dhcp server apply ip-pool 4vlan22
4、验证,查询分配出的地址。
[SW01]display dhcp server ip-in-use
参考:https://blog.csdn.net/hs_cs/article/details/116355399
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/35766.html