搭建如下拓扑
思路:
- 准备
- 基础配置
- 配置VLAN(管理VLAN和业务VLAN)和IP
- 配置DHCP(保证路由)
- 配置地址池
- 上线AP
- 设置组
- 配置域模块
- 配置国家码等(本文只配置了国家码)
- 配置AP
- 组加入域模块,AP加入组,建立capwap通道
- 配置WLAN业务参数
- 配置安全模板
- 配置SSID
- 配置VAP模板
- 配置转发方式
- 配置业务VLAN
- 引用两个模板
- 配置射频
准备
基础配置
[S1]vlan batch 100 101
Info: This operation may take a few seconds. Please wait for a moment...done.
//创建两个vlan,一个用来做管理vlan,一个用来做数据vlan
[S1]interface GigabitEthernet 0/0/2
[S1-GigabitEthernet0/0/2]port link-type trunk
[S1-GigabitEthernet0/0/2]port trunk allow-pass vlan 100 101
//配置成trunk接口,方便数据传输
[S1-GigabitEthernet0/0/2]quit
[S1]interface GigabitEthernet 0/0/3
[S1-GigabitEthernet0/0/3]port link-type trunk
[S1-GigabitEthernet0/0/3]port trunk allow-pass vlan 100 101
[S1-GigabitEthernet0/0/3]quit
[S1]interface GigabitEthernet 0/0/1
[S1-GigabitEthernet0/0/1]port link-type trunk
[S1-GigabitEthernet0/0/1]port trunk allow-pass vlan 100 101
[S1-GigabitEthernet0/0/1]quit
[AC]vlan batch 100 101
Info: This operation may take a few seconds. Please wait for a moment...done.
[AC]interface GigabitEthernet 0/0/1
[AC-GigabitEthernet0/0/1]port link-type trunk
[AC-GigabitEthernet0/0/1]port trunk allow-pass vlan 100 101
[AC-GigabitEthernet0/0/1]quit
[S3]vlan batch 100 101
Info: This operation may take a few seconds. Please wait for a moment...done.
[S3]interface GigabitEthernet 0/0/1
[S3-GigabitEthernet0/0/1]port link-type trunk
[S3-GigabitEthernet0/0/1]port trunk allow-pass vlan 100 101
[S3-GigabitEthernet0/0/1]quit
[S3]interface GigabitEthernet 0/0/2
[S3-GigabitEthernet0/0/2]port link-type trunk
[S3-GigabitEthernet0/0/2]port trunk pvid vlan 100
[S3-GigabitEthernet0/0/2]port trunk allow-pass vlan 100 101
[S3-GigabitEthernet0/0/2]quit
[S4]vlan batch 100 101
Info: This operation may take a few seconds. Please wait for a moment...done.
[S4]interface GigabitEthernet0/0/1
[S4-GigabitEthernet0/0/1] port link-type trunk
[S4-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 to 101
[S4-GigabitEthernet0/0/1]quit
[S4]interface GigabitEthernet0/0/2
[S4-GigabitEthernet0/0/2] port link-type trunk
[S4-GigabitEthernet0/0/2] port trunk pvid vlan 100
[S4-GigabitEthernet0/0/2] port trunk allow-pass vlan 100 to 101
[S4-GigabitEthernet0/0/2]quit
[S1]interface Vlanif 101
[S1-Vlanif101]ip address 192.168.101.254 24
STA的网关。
[S1-Vlanif101]quit
[S1]interface LoopBack 0
[S1-LoopBack0] ip address 10.0.1.1 32
//用来检验用,没有实际意义
[AC]interface Vlanif 100
[AC-Vlanif100]ip address 192.168.100.254 24
配置DHCP
[S1]dhcp enable
//开启dhcp
Info: The operation may take a few seconds. Please wait for a moment.done.
[S1]ip pool sta
Info:It's successful to create an IP address pool.
[S1-ip-pool-sta]network 192.168.101.0 mask 24
[S1-ip-pool-sta]gateway-list 192.168.101.254
将192.168.101.254设置成网关之后,分配地址时就不会将其分配出去
[S1-ip-pool-sta]quit
//创建地址池,用来分配sta(移动设备)
[S1]interface Vlanif 101
[S1-Vlanif101]dhcp select global
[S1-Vlanif101]quit
//vlan101使用本地dhcp设置。
[AC]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[AC]ip pool ap
Info: It is successful to create an IP address pool.
[AC-ip-pool-ap]network 192.168.100.254 mask 24
[AC-ip-pool-ap]gateway-list 192.168.100.254
[AC-ip-pool-ap]quit
[AC]interface Vlanif 100
[AC-Vlanif100]dhcp select global
[AC-Vlanif100]quit
AP上线
设置组
[AC]wlan
[AC-wlan-view]ap-group name ap-group1
Info: This operation may take a few seconds. Please wait for a moment.done.
创建组,设置组名
[AC-wlan-ap-group-ap-group1]quit
[AC]wlan
[AC-wlan-view]regulatory-domain-profile name default
创建域模板并取名
[AC-wlan-regulate-domain-default]country-code cn
Info: The current country code is same with the input country code.
配置国家码
[AC]wlan
[AC-wlan-view]ap-group name ap-group1
[AC-wlan-ap-group-ap-group1]regulatory-domain-profile default
将域模板配置给组1
Warning: Modifying the country code will clear channel, power and antenna gain configurations of the radio and reset the AP. Continue?[Y/N]:y
创建capwap隧道
[AC]capwap source interface Vlanif 100
capwap的源与vlan100绑定
加入AP
[AC]wlan
[AC-wlan-view]ap auth-mode mac-auth
采用使用mac地址的方式进行绑定
[AC-wlan-view]ap-id 0 ap-mac 60F1-8A9C-2B40
id是序号,后面跟上ap对应接口的mac地址
[AC-wlan-ap-0]ap-name ap1
取名字
[AC-wlan-ap-0]ap-group ap-group1
将AP加入到AP组中
Warning: This operation may cause AP reset. If the country code changes, it will clear channel, power and antenna gain configurations of the radio, Whether to continue? [Y/N]:y //需要输入y来确认继续
Info: This operation may take a few seconds. Please wait for a moment.. done.
[AC-wlan-ap-0]quit
[AC-wlan-view]ap-id 1 ap-mac B4FB-F9B7-DE40
[AC-wlan-ap-1]ap-name ap2
[AC-wlan-ap-1]ap-group ap-group1
Warning: This operation may cause AP reset. If the country code changes, it will clear channel, power and antenna gain configurations of the radio, Whether to continue? [Y/N]:y
Info: This operation may take a few seconds. Please wait for a moment.. done.
[AC-wlan-ap-1]quit
配置WLAN业务
[AC-wlan-view]security-profile name HCIA-WLAN
创建安全模板
[AC-wlan-sec-prof-HCIA-WLAN]security wpa-wpa2 psk pass-phrase HCIA-Datacom aes
配置预共项密钥认证和加密
[AC]wlan
[AC-wlan-view]ssid-profile name HCIA-WLAN
配置ssid模板
[AC-wlan-ssid-prof-HCIA-WLAN]ssid HCIA-WLAN
配置ssid名字
Info: This operation may take a few seconds, please wait.done.
[AC-wlan-ssid-prof-HCIA-WLAN]quit
[AC]wlan
[AC-wlan-view]vap-profile name HCIA-WLAN
配置VAP模板
[AC-wlan-vap-prof-HCIA-WLAN]forward-mode direct-forward
配置数据转发方式
[AC-wlan-vap-prof-HCIA-WLAN]service-vlan vlan-id 101
指定业务vlan
Info: This operation may take a few seconds, please wait.done.
[AC-wlan-vap-prof-HCIA-WLAN]security-profile HCIA-WLAN
引用安全模板“HCIA-WLAN”。
Info: This operation may take a few seconds, please wait.done.
[AC-wlan-vap-prof-HCIA-WLAN]ssid-profile HCIA-WLAN
引用SSID模板“HCIA-WLAN”。
Info: This operation may take a few seconds, please wait.done.
[AC-wlan-vap-prof-HCIA-WLAN]quit
[AC]wlan
[AC-wlan-view]ap-group name ap-group1
[AC-wlan-ap-group-ap-group1]vap-profile HCIA-WLAN wlan 1 radio all
配置射频都使用VAP的指定模板
Info: This operation may take a few seconds, please wait...done.
[AC-wlan-ap-group-ap-group1]quit