华为交换机dhcp全局模式和接口模式的配置
华为交换机dhcp全局模式和接口模式的配置
<Huawei>
<Huawei>undo terminal monitor
Info: Current terminal monitor is off.
<Huawei>
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW1
[SW1]
[SW1]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]
[SW1]interface vlanif 10
[SW1-Vlanif10]ip address 192.168.10.254 24
[SW1-Vlanif10]quit
[SW1]
[SW1]interface vlanif 20
[SW1-Vlanif20]ip address 192.168.20.254 24
[SW1-Vlanif20]quit
[SW1]
[SW1]interface G0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 10
[SW1-GigabitEthernet0/0/1]quit
[SW1]
[SW1]interface G0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 20
[SW1-GigabitEthernet0/0/2]quit
[SW1]
[SW1]
[SW1]# dhcp
[SW1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[SW1]interface vlanif 10
[SW1-Vlanif10]dhcp select interface
[SW1-Vlanif10]dhcp server dns-list 1.1.1.1
[SW1-Vlanif10]dhcp server excluded 192.168.10.200 192.168.10.253
[SW1-Vlanif10]dhcp server lease day 8
[SW1-Vlanif10]quit
[SW1]
[SW1]# dhcp
[SW1]interface vlanif 20
[SW1-Vlanif20]dhcp select global
[SW1-Vlanif20]ip pool 20
Info:It's successful to create an IP address pool.
[SW1-ip-pool-20]network 192.168.20.0 mask 24
[SW1-ip-pool-20]gateway-list 192.168.20.254
[SW1-ip-pool-20]dns-list 1.1.1.1
[SW1-ip-pool-20]excluded 192.168.10.100 192.168.10.254
Error:The IP address is not in the pool.
[SW1-ip-pool-20]lease day 8
[SW1-ip-pool-20]quit