资源描述
华为s5700交换机配置全局地址池dhcp服务器
<Huawei>system-view (进入全局模式)
[Huawei]sysname SW1 ( 设备命名)
[SW1]dhcp enable (使用DHCP功能)
[SW1]ip pool 10 (创建全局地址池,同时进入全局地址池视图)
[SW1-ip-pool-10]network 192.168.10.0 mask 24 (配置全局地址池可动态分配的IP地址范围)
[SW1-ip-pool-10]dns-list 8.8.8.8 (配置DNS )
[SW1-ip-pool-10]gateway-list 192.168.10.1 (配置网关)
[SW1-ip-pool-10]excluded-ip-address 192.168.10.201 192.168.10.254 (保留不被分配的地址)
[SW1-ip-pool-10]lease day 7 (IP租约期限)
[SW1-ip-pool-10]dis 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.10.201 192.168.10.254 (保留IP地址范围)
lease day 7 hour 0 minute 0 (IP租约周期)
dns-list 8.8.8.8
[SW1-ip-pool-10]quit (退出
[SW1]ip pool 20
[SW1-ip-pool-20]network 192.168.20.0 mask 24
[SW1-ip-pool-20]dns-list 8.8.8.8
[SW1-ip-pool-20]gateway-list 192.168.20.1
[SW1-ip-pool-20]excluded-ip-address 192.168.20.201 192.168.20.254
[SW1-ip-pool-20]lease day 7
[SW1-ip-pool-20]q
------------------------------------------------
[SW1]vlan batch 10 20 (批量创建vlan)
[SW1]interface GigabitEthernet 0/0/1 (进入port 1)
[SW1-GigabitEthernet0/0/1]port link-type access (配置port 1 类型)
[SW1-GigabitEthernet0/0/1]port default vlan 10 (配置port 1 vlan)
[SW1-GigabitEthernet0/0/1]quit (退出)
[SW1]interface GigabitEthernet 0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 20
[SW1-GigabitEthernet0/0/2]quit
( 配置VLANIF10接口下的客户端从全局地址池中获取IP地址)
[SW1]interface Vlanif 10 (创建vlanif 10)
[SW1-Vlanif10]ip address 192.168.10.1 24 (配置IP地址)
[SW1-Vlanif10]dhcp select global (在vlanif 10模式下调用全局地址池)
[SW1-Vlanif10]display this (查询当前配置参数)
#
interface Vlanif10
ip address 192.168.10.1 255.255.255.0
dhcp select global
#
Return
[SW1-Vlanif10]quit
[SW1]interface Vlanif 20
[SW1-Vlanif20]ip address 192.168.20.1 24
[SW1-Vlanif20]dhcp select global
[SW1-Vlanif20]quit
[SW1]display ip pool (查看IP地址池配置情况)
[SW1]quit
<SW1>save (保存配置,写入设备)
展开阅读全文