1、华为s5700交换机配置全局地址池dhcpSW1配置如下:sy system-view (进入全局模式)Enter system view, return user view with Ctrl+Z.Huaweisy Huaweisysname SW1 ( 设备命名)SW1SW1d SW1dhcp en SW1dhcp enable (使用DHCP功能)Info: The operation may take a few seconds. Please wait for a moment.done.SW1SW1ip pool 10 (创建全局地址池,同时进入全局地址池视图)Info:Its s
2、uccessful to create an IP address pool.SW1-ip-pool-10netw SW1-ip-pool-10network 192.168.10.0 m SW1-ip-pool-10network 192.168.10.0 mask 24(配置全局地址池可动态分配的IP地址范围)SW1-ip-pool-10SW1-ip-pool-10dns-list 8.8.8.8 (配置DNS )SW1-ip-pool-10SW1-ip-pool-10gateway-list 192.168.10.1 (配置网关)SW1-ip-pool-10ex SW1-ip-pool-
3、10excluded-ip-address 192.168.10.201 192.168.10.254 (保留不被分配的地址)SW1-ip-pool-10SW1-ip-pool-10lease d SW1-ip-pool-10lease day 7 (IP租约期限)SW1-ip-pool-10SW1-ip-pool-10dis this (查询当前模式的配置)#ip pool 10 gateway-list 192.168.10.1 (网关) network 192.168.10.0 mask 255.255.255.0 (IP地址范围) excluded-ip-address 192.168
4、.10.201 192.168.10.254 (保留IP地址范围) lease day 7 hour 0 minute 0 (IP租约周期) dns-list 8.8.8.8#returnSW1-ip-pool-10SW1-ip-pool-10SW1-ip-pool-10quit (退出)SW1SW1SW1SW1ip pool 20Info:Its successful to create an IP address pool.SW1-ip-pool-20SW1-ip-pool-20SW1-ip-pool-20netw SW1-ip-pool-20network 192.168.20.0 m
5、SW1-ip-pool-20network 192.168.20.0 mask 24SW1-ip-pool-20SW1-ip-pool-20SW1-ip-pool-20d SW1-ip-pool-20dns-list 8.8.8.8SW1-ip-pool-20SW1-ip-pool-20g SW1-ip-pool-20gateway-list 192.168.20.1SW1-ip-pool-20SW1-ip-pool-20SW1-ip-pool-20ex SW1-ip-pool-20excluded-ip-address 192.168.20.201 192.168.20.254SW1-ip-
6、pool-20SW1-ip-pool-20SW1-ip-pool-20l SW1-ip-pool-20lease d SW1-ip-pool-20lease day 7SW1-ip-pool-20SW1-ip-pool-20SW1-ip-pool-20SW1-ip-pool-20SW1-ip-pool-20dis this#ip pool 20 gateway-list 192.168.20.1 network 192.168.20.0 mask 255.255.255.0 excluded-ip-address 192.168.20.201 192.168.20.254 lease day
7、7 hour 0 minute 0 dns-list 8.8.8.8#returnSW1-ip-pool-20SW1-ip-pool-20SW1-ip-pool-20qSW1SW1SW1v SW1vlan b SW1vlan batch 10 20 (批量创建vlan)Info: This operation may take a few seconds. Please wait for a moment.done.SW1SW1SW1int SW1interface g SW1interface GigabitEthernet 0/0/1 (进入port 1)SW1-GigabitEthern
8、et0/0/1por SW1-GigabitEthernet0/0/1port l SW1-GigabitEthernet0/0/1port link-t SW1-GigabitEthernet0/0/1port link-type a SW1-GigabitEthernet0/0/1port link-type access (配置port 1 类型)SW1-GigabitEthernet0/0/1SW1-GigabitEthernet0/0/1SW1-GigabitEthernet0/0/1port SW1-GigabitEthernet0/0/1port def SW1-GigabitE
9、thernet0/0/1port default v SW1-GigabitEthernet0/0/1port default vlan 10 (配置port 1 vlan)SW1-GigabitEthernet0/0/1SW1-GigabitEthernet0/0/1quit (退出)SW1SW1int SW1interface g SW1interface GigabitEthernet 0/0/2SW1-GigabitEthernet0/0/2SW1-GigabitEthernet0/0/2SW1-GigabitEthernet0/0/2SW1-GigabitEthernet0/0/2p
10、or SW1-GigabitEthernet0/0/2port l SW1-GigabitEthernet0/0/2port link-t SW1-GigabitEthernet0/0/2port link-type a SW1-GigabitEthernet0/0/2port link-type access SW1-GigabitEthernet0/0/2SW1-GigabitEthernet0/0/2por SW1-GigabitEthernet0/0/2port def SW1-GigabitEthernet0/0/2port default v SW1-GigabitEthernet
11、0/0/2port default vlan 20SW1-GigabitEthernet0/0/2SW1-GigabitEthernet0/0/2quitSW1SW1SW1SW1int SW1interface v ( 配置VLANIF10接口下的客户端从全局地址池中获取IP地址)SW1interface Vlanif 10 (创建vlanif 10)SW1-Vlanif10SW1-Vlanif10SW1-Vlanif10ip add SW1-Vlanif10ip address 192.168.10.1 24 (配置IP地址)SW1-Vlanif10SW1-Vlanif10dhcp sel
12、SW1-Vlanif10dhcp select g SW1-Vlanif10dhcp select global (在vlanif 10模式下调用全局地址池)SW1-Vlanif10SW1-Vlanif10SW1-Vlanif10dis SW1-Vlanif10display this (查询当前配置参数)#interface Vlanif10 ip address 192.168.10.1 255.255.255.0 dhcp select global#returnSW1-Vlanif10SW1-Vlanif10SW1-Vlanif10quitSW1SW1SW1int SW1interfa
13、ce v SW1interface Vlanif 20SW1-Vlanif20SW1-Vlanif20SW1-Vlanif20ip add SW1-Vlanif20ip address 192.168.20.1 24SW1-Vlanif20SW1-Vlanif20dhcp SW1-Vlanif20dhcp sel SW1-Vlanif20dhcp select g SW1-Vlanif20dhcp select global SW1-Vlanif20SW1-Vlanif20dis this#interface Vlanif20 ip address 192.168.20.1 255.255.2
14、55.0 dhcp select global#returnSW1-Vlanif20SW1-Vlanif20SW1-Vlanif20quitSW1SW1dis SW1display ip pool (查看IP地址池配置情况) - Pool-name : 10 Pool-No : 0 Position : Local Status : Unlocked Gateway-0 : 192.168.10.1 Mask : 255.255.255.0 VPN instance : - - Pool-name : 20 Pool-No : 1 Position : Local Status : Unloc
15、ked Gateway-0 : 192.168.20.1 Mask : 255.255.255.0 VPN instance : - IP address Statistic Total :506 Used :0 Idle :398 Expired :0 Conflict :0 Disable :108 SW1SW1SW1quitsave (保存配置,写入设备)The current configuration will be written to the device.Are you sure to continue?Y/NyNow saving the current configuration to the slot 0.Mar 18 2017 13:30:47-08:00 SW1 %01CFM/4/SAVE(l)63:The user chose Y when deciding whether to save the configuration to the device.Save the configuration successfully.PC情况如下
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1