<H3C> system-view
[H3C] sysname CoreSwitch
# 1. 创建业务VLAN 10和管理VLAN 100
[CoreSwitch] vlan 10
[CoreSwitch-vlan10] quit
[CoreSwitch] vlan 100
[CoreSwitch-vlan100] quit
# 2. 配置VLAN接口地址(作为终端的网关)
[CoreSwitch] interface vlan-interface 10
[CoreSwitch-Vlan-interface10] ip address 192.168.10.1 255.255.255.0
[CoreSwitch-Vlan-interface10] quit
[CoreSwitch] interface vlan-interface 100
[CoreSwitch-Vlan-interface100] ip address 192.168.100.1 255.255.255.0
[CoreSwitch-Vlan-interface100] quit
# 3. 开启DHCP服务,并配置两个地址池
[CoreSwitch] dhcp enable
# 业务VLAN 10的地址池(给无线终端分配地址)
[CoreSwitch] dhcp server ip-pool vlan10
[CoreSwitch-dhcp-pool-vlan10] network 192.168.10.0 mask 255.255.255.0
[CoreSwitch-dhcp-pool-vlan10] gateway-list 192.168.10.1
[CoreSwitch-dhcp-pool-vlan10] dns-list 114.114.114.114
[CoreSwitch-dhcp-pool-vlan10] quit
# 管理VLAN 100的地址池(给AP分配地址)
# 关键:必须配置option 43,告诉AP去哪里找AC(M60的地址)
[CoreSwitch] dhcp server ip-pool vlan100
[CoreSwitch-dhcp-pool-vlan100] network 192.168.100.0 mask 255.255.255.0
[CoreSwitch-dhcp-pool-vlan100] gateway-list 192.168.100.1
# 假设M60的管理地址是192.168.100.100,需提前在M60上配置好
[CoreSwitch-dhcp-pool-vlan100] option 43 ip-address 192.168.100.100
[CoreSwitch-dhcp-pool-vlan100] quit
# 4. 配置接口(以常见的千兆口为例)
# 接口 G0/6:连接M60 AC(纯AC模式,只需透传管理VLAN 100)
[CoreSwitch] interface gigabitethernet 0/6
[CoreSwitch-GigabitEthernet0/6] port link-type trunk
[CoreSwitch-GigabitEthernet0/6] port trunk permit vlan 100
[CoreSwitch-GigabitEthernet0/6] quit
# 接口 万兆口 25:连接傻瓜交换机(Access模式,接入VLAN 10)
# 傻瓜交换机下的所有终端都将属于VLAN 10,从地址池vlan10获取IP
[CoreSwitch] interface Ten-GigabitEthernet 0/0/25
[CoreSwitch-Ten-GigabitEthernet0/0/25] port link-type access
[CoreSwitch-Ten-GigabitEthernet0/0/25] port access vlan 10
[CoreSwitch-Ten-GigabitEthernet0/0/25] quit
# 接口 G0/1:示例,连接AP(或下联PoE交换机)
# 必须是Trunk,PVID为管理VLAN 100,同时放行业务VLAN 10
[CoreSwitch] interface gigabitethernet 0/1
[CoreSwitch-GigabitEthernet0/1] port link-type trunk
[CoreSwitch-GigabitEthernet0/1] port trunk pvid vlan 100 # AP的管理VLAN
[CoreSwitch-GigabitEthernet0/1] port trunk permit vlan 10 100 # 放行管理和业务VLAN
[CoreSwitch-GigabitEthernet0/1] quit
暂无评论