2023年12月25日发(作者:)

WLAN 配置示例 2(旁挂组网隧道 or 直接转发),这种方式比较适合中小型企业,AC 旁挂在三层交换机旁边,只是用于

来与 AP 建立 CAPWAP 隧道,下发业务给 AP,如果在隧道方式下的话,那么业务流量也会由 CAPWAP 隧道进行封装交给

AC 处理,再由 AC 来转发,而直接转发的话,则由 AP 本地交换了,不需要交给 AC,这样可以减轻 AC 的负担,具体使用

可以根据需求来决定。

掌握目标

1、理解旁挂组网与直接 or 隧道转发的方式

2、AP 静态关联 AC 的方法【补充,之前都是以动态或者 option43 方式】

3、三层交换机配置

4、AC 的配置

5、只允许访客访问特定的流量,通过 ACL 下放

拓扑具体的 VLAN 信息与 IP 网段都包括,该实验主要是演示三层组网 旁挂+隧道或者直接转发方式的组网情况,并且包括

怎么通过 AC 上面配置 ACL 来下放到 AP 上面限制客户端的流量。

1、理解旁挂组网与直接 or 隧道转发的方式

如果在隧道方式下的话,那么业务流量也会由 CAPWAP 隧道进行封装交给 AC 处理,再由 AC 来转发,而直接转发的话,

则由 AP 本地交换了,不需要交给 AC,这样可以减轻 AC 的负担,还可以配需华为的 feature,在 AC 失效后,AP 还能继续

为客户端提供业务转发。

2、AP 静态关联 AC 的方法【补充,之前都是以动态或者 option43 方式】

在 AP 上面配置模式为静态,配置自己的 IP 地址与网关,最后指定 AC 的地址在哪,重启设备即可。

3、三层交换机配置

dhcp enable

interface Vlanif100

ip address 10.1.100.1 255.255.255.0

dhcp select interface

dhcp server option 43 sub-option 3 ascii 10.1.201.100

这里配置了 option 43,指定 AC 的地址

#

interface Vlanif101

ip address 10.1.101.1 255.255.255.0

dhcp select interface

dhcp server dns-list 8.8.8.8

#

interface Vlanif102

ip address 10.1.102.1 255.255.255.0

dhcp select interface

dhcp server dns-list 8.8.8.8

#

interface Vlanif200

ip address 10.1.200.2 255.255.255.0

#

interface Vlanif800

ip address 10.1.201.1 255.255.255.0

#

interface MEth0/0/1

#

interface GigabitEthernet0/0/1

port link-type access

port default vlan 100

#

interface GigabitEthernet0/0/2

port link-type access

port default vlan 100

#

interface GigabitEthernet0/0/3

port link-type access

port default vlan 200

#

interface GigabitEthernet0/0/4

port link-type trunk

port trunk allow-pass vlan 100 to 102 200 800

说明:这里演示是以隧道方式组网演示的,所以交换机接 AP 的接口都为 Access 接口,如果是直接转发的话,那么必须为

hybrid 或者 trunk,其中 PVID 必须等于 AC 的源地址的 VLAN,也就是与 AP 建立 CAPWAP 隧道的 VLAN,为管理 VLAN,

然后还需要放行业务 VLAN,否则 PC 关联不上,DHCP 获取不到地址。!!!

ospf 1 router-id 3.3.3.3

area 0.0.0.0

network 10.1.200.2 0.0.0.0

network 10.1.201.1 0.0.0.0

area 0.0.0.1

network 10.1.100.1 0.0.0.0

network 10.1.101.1 0.0.0.0

network 10.1.102.1 0.0.0.0

4、AC 的配置

acl number 3001

rule 5 permit ip destination 10.1.201.100 0

rule 10 deny ip destination 10.0.0.0 0.255.255.255

rule 15 permit ip

说明:拒绝访客访问内部员工网络

interface Vlanif103

ip address 192.168.103.1 255.255.255.0

traffic-filter inbound acl 3001

dhcp select interface

dhcp server dns-list 8.8.8.8

#

interface Vlanif800

ip address 10.1.201.100 255.255.255.0

#

ospf 1 router-id 2.2.2.2

area 0.0.0.0

network 10.1.201.100 0.0.0.0

area 0.0.0.103

network 192.168.103.1 0.0.0.0

interface GigabitEthernet0/0/1

port link-type trunk

port trunk allow-pass vlan 100 to 102 800

interface Wlan-Ess0

port hybrid untagged vlan 101

#

interface Wlan-Ess1

port hybrid untagged vlan 102

#

interface Wlan-Ess2

port hybrid untagged vlan 103

说明:该接口用来关联每一个服务集的,下发的时候告诉下面的 AP 打上什么样的 VLAN。

wlan

wlan ac source interface vlanif800

ap id 0 type-id 19 mac 00e0-fc03-d740 sn 21C6FFC3E 【采用 MAC 认证方式来让 AP 上线】

ap id 1 type-id 19 mac 00e0-fc03-1360 sn 216DC543

wmm-profile name wmm id 0

traffic-profile name tra id 0

security-profile name sec id 0

service-set name valn101 id 0

VLAN 101】

forward-mode tunnel

wlan-ess 0

ssid vlan101

traffic-profile id 0

security-profile id 0

service-vlan 101

service-set name vlan102 id 1

forward-mode tunnel

wlan-ess 1

ssid vlan102

traffic-profile id 0

security-profile id 0

【创建一个服务集,它的转发方式为 tunnel,关联了 WLAN-ESS0 接口,SSID 为

service-vlan 102

service-set name guest103 id 2

forward-mode tunnel

wlan-ess 2

ssid vlan103

user-isolate

traffic-profile id 0

security-profile id 0

service-vlan 103

radio-profile name 2g11n id 0

radio-type 80211bgn

wmm-profile id 0

radio-profile name 5g11n id 1

radio-type 80211an

wmm-profile id 0

ap 0 radio 0

多个的,可以多个 SSID】

radio-profile id 0

service-set id 0 wlan 1

service-set id 1 wlan 2

service-set id 2 wlan 3

ap 0 radio 1

【在 ap 的射频下,0 表示 2.4G,关联刚刚的射频 profile,然后关联服务集,服务集是可以关联

【指定射频类型为 5G 的,关联 WMM】

【指定射频类型为 2.4G 的,关联 WMM】

radio-profile id 1

channel 40MHz-minus 153

service-set id 0 wlan 1

service-set id 1 wlan 2

service-set id 2 wlan 3

ap 1 radio 0

radio-profile id 0

channel 20MHz 6

service-set id 0 wlan 1

service-set id 1 wlan 2

service-set id 2 wlan 3

ap 1 radio 1

radio-profile id 1

channel 40MHz-minus 161

service-set id 0 wlan 1

service-set id 1 wlan 2

service-set id 2 wlan 3

说明:注意频段不要冲突,这里要手工修改下,模拟器不支持自动分配。

这里用的的 tunnel 转发模式的,默认情况下为直接,所以如果想为直接的转发模式,可以不需要配置 forward-mode

tunnel,如果为直接转发的话,那么交换机注意不能为 Access 接口,必须为 hybrid 或者 trunk,PVID=AC 与 AP 建立

CAWPWAP 隧道的 VLAN,然后给业务 VLAN 打上 Tag,否则会出现客户端连接不了 AP,获取不到地址的情况。

5、只允许访客访问特定的流量,通过 ACL 下放

在 tunnel 的模式下,所有的流量都是会经过 AC 上面的 VLAN 接口的,所以策略是在 AC 的 VLAN 接口下做,但是如果是

直接转发就不一样了。

acl number 3001

rule 5 permit ip destination 10.1.201.100 0

rule 10 deny ip destination 10.0.0.0 0.255.255.255

rule 15 permit ip

说明:拒绝访客访问内部员工网络

service-set name guest103 id 2

traffic-filter inbound acl 3001

它会在 AP 关联的时候,就会自动下发给 AP,那么 AP 的接口上面就会有该 ACL,直接在 AP 上面对客户端的流量做限制。

所以在做控制的时候,一定要区分是在什么方式下,是直接转发还是隧道转发,不同的模式,策略应用的方式也不一样。