实验目的
1.掌握认证AP上线的配置方法
2.掌握各种无线配置模板配置
3.掌握WLAN配置的基本流程
实验拓扑
实验拓扑如图15-1所示:
![](https://img-blog.csdnimg.cn/img_convert/2fc0ca6c40b528e0ff00324918daf1d4.png)
图15-1 WLAN无线综合实验
特别说明:本实验参考《华为HCIA-Datacom认证实验指南》
![](https://img-blog.csdnimg.cn/img_convert/b1a25adae6a42c9dc29d8de84bbce808.jpeg)
《华为HCIA-Datacom认证实验指南》
3、实验步骤
步骤1:基本配置
LSW2的配置
<Huawei>system-view
[Huawei]undo info-center enable
[Huawei]sysname LSW2
[LSW2]vlan 100
[LSW2-vlan100]quit
[LSW2]interface e0/0/1
[LSW2-Ethernet0/0/1]port link-type trunk
[LSW2-Ethernet0/0/1]port trunk allow-pass vlan 100
[LSW2-Ethernet0/0/1]port trunk pvid vlan 100
[LSW2-Ethernet0/0/1]quit
[LSW2]interface e0/0/2
[LSW2-Ethernet0/0/2]port link-type trunk
[LSW2-Ethernet0/0/2]port trunk allow-pass vlan 100
[LSW2-Ethernet0/0/2]port trunk pvid vlan 100
[LSW2-Ethernet0/0/2]quit
[LSW2]interface e0/0/3
[LSW2-Ethernet0/0/3]port link-type trunk
[LSW2-Ethernet0/0/3]port trunk allow-pass vlan 100
[LSW2-Ethernet0/0/3]quit
【思考1】:为什么LSW2只创建VLAN100,不用创建VLAN101?
解析:因为我们用的是隧道转发,数据到达AC1后,才会打上101标记然后发给LSW1
【思考2】:为什么连接AP的接口要打port trunk pvid vlan 100?
解析:交换机收到AP的数据帧打上100的tag发送
把带上100tag的数据帧去掉然后发给AP
LSW1的配置
<Huawei>system-view
[Huawei]undo info-center enable
[Huawei]sysname LSW1
[LSW1]vlan batch 100 101
[LSW1]interface g0/0/1
[LSW1-GigabitEthernet0/0/1]port link-type trunk
[LSW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 100
[LSW1-GigabitEthernet0/0/1]quit
[LSW1]interface g0/0/3
[LSW1-GigabitEthernet0/0/3]port link-type trunk
[LSW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 100 101
[LSW1-GigabitEthernet0/0/3]quit
[LSW1]interface g0/0/2
[LSW1-GigabitEthernet0/0/2]port link-type access
[LSW1-GigabitEthernet0/0/2]port default vlan 101
[LSW1-GigabitEthernet0/0/2]quit
[LSW1]interface Vlanif 101
[LSW1-Vlanif101]ip address 192.168.101.1 24
[LSW1-Vlanif101]undo shutdown
[LSW1-Vlanif101]quit
AC1的配置
<AC6005>system-view
[AC6005]undo info-center enable
[AC6005]sysname AC1
[AC1]vlan batch 100 101
[AC1]interface g0/0/1
[AC1-GigabitEthernet0/0/1]port link-type trunk
[AC1-GigabitEthernet0/0/1]port trunk allow-pass vlan 100 101
[AC1-GigabitEthernet0/0/1]quit
[AC1]interface Vlanif 100
[AC1-Vlanif100]ip address 192.168.100.1 24
[AC1-Vlanif100]undo shutdown
[AC1-Vlanif100]quit
R1的配置
<Huawei>system-view
[Huawei]undo info-center enable
[Huawei]sysname R1
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.101.2 24
[R1-GigabitEthernet0/0/0]undo shutdown
[R1-GigabitEthernet0/0/0]quit
步骤2:设置DHCP
创建VLAN设置TRUNK
业务DHCP-让STA获得IP地址
[LSW1]dhcp enable
[LSW1]interface Vlanif 101
[LSW1-Vlanif101]dhcp select interface
[LSW1-Vlanif101]quit
管理DHCP-让AP获得IP地址
<AC1>system-view
[AC1]dhcp enable
[AC1]interface Vlanif 100
[AC1-Vlanif100]dhcp select interface
[AC1-Vlanif100]quit
步骤3:AC的配置
AP上线
第一步:创建AP组
<AC1>system-view
[AC1]wlan
[AC1-wlan-view]ap-group name x //创建AP组名字叫x
[AC1-wlan-ap-group-x]quit
第二步:创建域管理模板并关联到AP组
[AC1]wlan
[AC1-wlan-view]regulatory-domain-profile name x1 //创建域管理模板,名字叫x1
[AC1-wlan-regulate-domain-x1]country-code cn //国家代码选择中国
[AC1-wlan-regulate-domain-x1]quit
[AC1-wlan-view]ap-group name x
[AC1-wlan-ap-group-x]regulatory-domain-profile x1 //AP组的域管理模板是x1
Warning: Modifying the country code will clear channel, power and antenna gain c
onfigurations of the radio and reset the AP. Continue?[Y/N]:y
[AC1-wlan-ap-group-x]quit
第三步:配置AC的接口源地址
[AC1]capwap source interface Vlanif 100 //AC的接口源地址为VLAN100
第四步:离线导入AP
[AC1]wlan
[AC1-wlan-view]ap auth-mode mac-auth //AP的认证模式为MAC认证
[AC1-wlan-view]ap-id 1 ap-mac 00e0-fcd5-1c70 //AP的编号和MAC地址
[AC1-wlan-ap-1]ap-name ds //AP的名字为ds
[AC1-wlan-ap-1]ap-group x //AP属于AP组x
[AC1-wlan-view]ap-id 2 ap-mac 00e0-fc1e-3670 //AP的编号和MAC地址
[AC1-wlan-ap-2]ap-name xs //Ap的名字
[AC1-wlan-ap-2]ap-group x //AP属于AP组x
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 c
ontinue? [Y/N]:y
思考:AP的MAC地址是怎么知道的?
读者可以通过在ap上使用命令“display interface Vlanif 1”查看当前ap的mac地址,然后再将mac地址进行绑定。
查看命令:
[AC1]display ap all
Info: This operation may take a few seconds. Please wait for a moment.done.
Total AP information:
nor : normal [2]
------------------------------------------------------------------------------------------
ID MAC Name Group IP Type State STA Uptime
------------------------------------------------------------------------------------------
1 00e0-fcd5-1c70 ds x 192.168.100.137 AP2050DN nor 0 11M:2S
2 00e0-fc1e-3670 xs x 192.168.100.42 AP2050DN nor 0 54S
------------------------------------------------------------------------------------------
可以看到两个AP都获取了IP地址,
思考:以上过程一共几包?
AP获取IP地址4个包:discovery、offer、request、ack
CAPWAP的建立2个包:discovery request(udp 目的端口5246广播找AC) discovery response(单播回应AP)
AP接入控制2个包:join request(udp 5246端口单播) join response
隧道维持2个包:数据隧道:keepalive(udp 5247) 控制隧道:echo(udp 5246)
配置VLAN业务参数
第一步:创建安全模板
[AC1]wlan
[AC1-wlan-view]security-profile name y1 //安全模板的名字叫y1
[AC1-wlan-sec-prof-y1]security wpa-wpa2 psk pass-phrase huaweihuiwei@123 aes //密码是huawei@123,用AES加密。
[AC1-wlan-sec-prof-y1]quit
第二步:创建SSID模板
[AC1]wlan
[AC1-wlan-view]ssid-profile name y2 //ssid的模板名字叫y2
[AC1-wlan-ssid-prof-y2]ssid hcia //ssid的名称叫hcia
[AC1-wlan-ssid-prof-y2]quit
[AC1-wlan-view]quit
第三步:创建VAP模板
[AC1]wlan
[AC1-wlan-view]vap-profile name y //vap模板的名字叫y
[AC1-wlan-vap-prof-y]forward-mode tunnel //转发模式为隧道
[AC1-wlan-vap-prof-y]service-vlan vlan-id 101 //服务的VLAN为101
[AC1-wlan-vap-prof-y]security-profile y1 //调用安全模板y1
[AC1-wlan-vap-prof-y]ssid-profile y2 //调用SSID模板y2
[AC1-wlan-vap-prof-y]quit
第四步:在AP组里面调用VAP模板
[AC1-wlan-view]ap-group name x
[AC1-wlan-ap-group-x]vap-profile y wlan 1 radio 0 //调用VAP模板y
[AC1-wlan-ap-group-x]vap-profile y wlan 1 radio 1 //
思考:radio0 1 2 是什么意思?
思考:这相过程要几个包?
WLAN业务配置下发2个包:Configuration Update Request Configuration Update Response
STA接入,可以看到有两个ssid为hcia的无线网络,在之前的配置中配置了radio 0 、1就是为了释放两个不同的射频信号,选择其中一个,输入之前创建的密码huawei@123
![](https://img-blog.csdnimg.cn/img_convert/a9cab668c84a6e259e148835d588d775.png)
登录完成后,读者可以点击命令行,输入ipconfig查看是否获取到ip地址,以及使用ping测试是否能访问R1设备,在下面的测试结果中可以看到,已经获取到业务vlan的ip地址并且能够访问R1,表示实验完成。
![](https://img-blog.csdnimg.cn/img_convert/fcb1cb348679f8777acc246e00c01da4.png)
思考:如果改成直接转发要更改哪些配置
①LSW2上要创建VLAN101、所有接口要允许vlan100 101通过。
②将LWS1和LSW2连接的接口允许vlan101通过。
③将vap模板的转发类型改成直连转发。
附:WLAN命令汇总
![](https://img-blog.csdnimg.cn/img_convert/e4b08f061bb59f8c0d5e1d00995c353e.png)