最详细的WLAN无线综合实验

WLAN无线综合实验

  1. 实验拓扑

 WLAN无线综合实验

2.实验步骤

  1. 步骤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

  1. 步骤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

  1. 步骤3:AC的配置
  •  AP上线

第一步:创建AP组

<AC1>system-view

[AC1]wlan

[AC1-wlan-view]ap-group name x  //创建AP组名字叫x

[AC1-wlan-ap-group-xjoinlabs]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 huawei@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

登录完成后,读者可以点击命令行,输入ipconfig查看是否获取到ip地址,以及使用ping测试是否能访问R1设备,在下面的测试结果中可以看到,已经获取到业务vlan的ip地址并且能够访问R1,表示实验完成。

思考:如果改成直接转发要更改哪些配置

LSW2上要创建VLAN101、所有接口要允许vlan100 101通过。

②将LWS1和LSW2连接的接口允许vlan101通过。

③将vap模板的转发类型改成直连转发。

15.3WLAN命令汇总

表15-1列出了本章出现的命令:

                                                             表15-1WLAN命令汇总

命令

作用

ap-group name ap-group1

创建AP组,并进入AP组视图

regulatory-domain-profile name default

创建域管理模板,并进入模板视图

country-code cn

配置设备的国家码标识

capwap source interface vlanif 100

配置AC与AP建立CAPWAP隧道的源接口

ap auth-mode mac-auth

配置AP认证模式为MAC地址认证

ap-id 0 ap-mac 60de-4476-e360

离线增加AP设备

ap-name area_1

配置单个AP的名称

security-profile name wlan-net

创建安全模板或者进入安全模板视图

ssid-profile name wlan-net

创建SSID模板,并进入模板视图

vap-profile name wlan-net

创建VAP模板,并进入模板视图

forward-mode tunnel

配置VAP模板下的数据转发方式,可以是直接转发或隧道转发

display vap ssid wlan-net

display ap

查看AP信息

本文出自作者的《华为认证HCIA-datacom认证实验指南》

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值