组网方式
AP与Switch端口
配置Switch和AP相连的接口GigabitEthernet1/0/1为Trunk类型,禁止VLAN 1报文通过,允许VLAN 100和VLAN 200通过,当前Trunk口的PVID为100。
[Switch] interface GigabitEthernet 1/0/1
[Switch-GigabitEthernet1/0/1] port link-type trunk
[Switch-GigabitEthernet1/0/1] undo port trunk permit vlan 1
[Switch-GigabitEthernet1/0/1] port trunk permit vlan 100 200
[Switch-GigabitEthernet1/0/1] port trunk pvid vlan 100
AC上:
interface GigabitEthernet1/0/1
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 100
AC与Switch端口
配置Switch和AC相连的接口GigabitEthernet1/0/48为Trunk类型,禁止VLAN 1报文通过,允许VLAN 100通过
interface GigabitEthernet1/0/48
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 100
配置AC
(1) 配置AC的接口
创建VLAN 100及其对应的VLAN接口,并为该接口配置IP地址。AP将获取该IP地址与AC建立CAPWAP隧道。
system-view
[AC] vlan 100
[AC-vlan100] quit
[AC] interface vlan-interface 100
[AC-Vlan-interface100] ip address 192.1.1.1 16
[AC-Vlan-interface100] quit
(2) 配置无线服务
创建无线服务模板1,并进入无线服务模板视图。
[AC] wlan service-template 1
配置SSID为service。
[AC-wlan-st-1] ssid service
配置本地转发模式,开启VLAN 200的本地转发功能。
[AC-wlan-st-1] client forwarding-location ap vlan 200
开启无线服务模板。
[AC-wlan-st-1] service-template enable
[AC-wlan-st-1] quit
(3) 配置AP
创建手工AP,名称为officeap,型号名称为WA4320i-ACN。
[AC] wlan ap officeap model WA4320i-ACN
设置AP序列号为219801A0T78159E09083。
[AC-wlan-ap-officeap] serial-id 219801A0T78159E09083
进入AP的Radio 2视图,并将无线服务模板1绑定到Radio 2上。
[AC-wlan-ap-officeap] radio 2
[AC-wlan-ap-officeap-radio-2] service-template 1 vlan 200
开启Radio 2的射频功能。
[AC-wlan-ap-officeap-radio-2] radio enable
[AC-wlan-ap-officeap-radio-2] quit
(4) 配置AP的配置文件
在AC上将配置文件apcfg.txt下发到AP。
[AC-wlan-ap-officeap] map-configuration apcfg.txt
[AC-wlan-ap-officeap] quit
Switch的配置
(1) 配置Switch的接口
创建VLAN 100和VLAN 200及其对应接口,并为该接口配置IP地址,其中VLAN 100用于转发AC和AP间CAPWAP隧道内的流量,VLAN 200用于转发Client无线报文。
[Switch] vlan 100
[Switch-vlan100] quit
[Switch] interface vlan-interface 100
[Switch-Vlan-interface100] ip address 192.1.1.2 16
[Switch-Vlan-interface100] quit
[Switch] vlan 200
[Switch-vlan200] quit
[Switch] interface vlan-interface 200
[Switch-Vlan-interface200] ip address 192.2.1.2 24
[Switch-Vlan-interface200] quit
开启Switch和AP相连的接口GigabitEthernet1/0/2的PoE供电功能。
[Switch-GigabitEthernet1/0/1] poe enable
[Switch-GigabitEthernet1/0/1] quit
配置DHCP服务
开启DHCP功能。
[Switch] dhcp enable
创建名为vlan100的DHCP地址池,配置地址池动态分配的网段为192.1.0.0/16,网关地址为192.1.1.2,为AP分配IP地址。
[Switch] dhcp server ip-pool vlan100
[Switch-dhcp-pool-vlan100] network 192.1.0.0 mask 255.255.0.0
[Switch-dhcp-pool-vlan100] forbidden-ip 192.1.1.1
[Switch-dhcp-pool-vlan100] gateway-list 192.1.1.2
[Switch-dhcp-pool-vlan100] quit
创建名为vlan200的DHCP地址池,配置地址池动态分配的网段为192.2.1.0/24,为Client分配的DNS服务器地址为网关地址(实际使用过程中请根据实际网络规划配置无线客户端的DNS服务器地址),网关地址为192.2.1.2,为Client分配IP地址。
[Switch] dhcp server ip-pool vlan200
[Switch-dhcp-pool-vlan200] network 192.2.1.0 mask 255.255.255.0
[Switch-dhcp-pool-vlan200] forbidden-ip 192.2.1.1
[Switch-dhcp-pool-vlan200] gateway-list 192.2.1.2
[Switch-dhcp-pool-vlan200] dns-list 192.2.1.2
[Switch-dhcp-pool-vlan200] quit
验证配置
查看AP是已经上线,AC ping 给AP分配的管理地址192.1.0.1,通过抓包可以发现ICMP报文不需要经过AC与AP间的隧道封装,直接转发。
Switch上查看LLDP等信息