一、vlan10全局地址池DHCP分配
<Huawei>undo terminal monitor #关闭消息提示
Info: Current terminal monitor is off.
<Huawei>sys #进入系统视图模式
Enter system view, return user view with Ctrl+Z.
[Huawei] dhcp enable #开启DHCP功能
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]vlan 10 #创建vlan10
[Huawei-vlan10]q
[Huawei]int vlan 10 #进入vlan10接口
[Huawei-Vlanif10]ip add 192.168.1.254 24
[Huawei-Vlanif10] dhcp select global #使用全局地址池
[Huawei-Vlanif10]q
[Huawei]ip pool vlan10 #设置地址池
Info:It's successful to create an IP address pool.
[Huawei-ip-pool-vlan10]net 192.168.1.0 mask 255.255.255.0 #设置分配的网段
[Huawei-ip-pool-vlan10]dns-li 8.8.8.8 114.114.114.114 #设置DNS
[Huawei-ip-pool-vlan10]gateway 192.168.1.254 #设置网关
[Huawei-ip-pool-vlan10]exc 192.168.1.200 192.168.1.253 #设置不参与分配的IP地址
[Huawei-ip-pool-vlan10]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port lin ac #设置接口模式为access模式
[Huawei-GigabitEthernet0/0/1]port def vlan 10 #接口默认为VLAN10
[Huawei-GigabitEthernet0/0/1]q
[Huawei]q
用客户端测试DHCP是否正常
地址获取成功,配置完成。
二、vlan20接口地址池DHCP地址分配
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan 20
[Huawei-vlan20]q
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port lin ac
[Huawei-GigabitEthernet0/0/2]port def vlan 20
[Huawei-GigabitEthernet0/0/2]int vlan 20
[Huawei-Vlanif20]ip add 192.168.2.254 24
[Huawei-Vlanif20]dhcp select interface
[Huawei-Vlanif20]dhcp server dns-list 202.102.152.3
[Huawei-Vlanif20]dhcp server excluded-ip-address 192.168.2.200 192.168.2.252
[Huawei-Vlanif20]dhcp select interface #启用DHCP接口模式
[Huawei-Vlanif20]q
客户端测试DHCP服务器分配正常
二〇一四年六月十四日 13:39:33
评论区