客户这边需要无线的业务vlan有3个vlan一共有3个网段,无线用户在获取业务vlan的ip地址的时候随机获取到其中一个vlan的ip地址,请问这个怎么配置?有没有配置案例?
如上
(0)
最佳答案
使用vlan组,案例是两个AC,配置的时候只需要配置一个按照AC1配置即可。
组网需求
如图1所示,Switch作为DHCP服务器为AP和Client分配IP地址,两台AC互为主备:
·在AC上配置vlan-group,让客户端在两台AC之间实现漫游。
·AP1注册到AC1和AC2,AC1为主;AP2注册到AC1和AC2,AC2为主。
1. 配置AC1
(1) 在AC1上配置相关VLAN和对应虚接口地址,并放通对应接口。
(2) 配置vlan-group,给客户端分配vlan 10,20,30,40。
[AC] vlan-group roam
[AC-vlan-group-roam] vlan-list 10 20 30 40
(3) 配置服务模板。
# 创建无线服务模板1,并进入无线服务模板视图。
[AC] wlan service-template 1
[AC-wlan-st-1] ssid service
# 配置给客户端分配的VLAN为静态模式。
[AC-wlan-st-1] client vlan-alloc static
[AC-wlan-st-1] service-template enable
(4) 配置AP,调用服务模板的同时调用vlan-group。
[AC] wlan ap officeap model WA4320i-ACN
[AC-wlan-ap-officeap] serial-id 210235A1GQC152001076
[AC-wlan-ap-officeap] radio 2
[AC-wlan-ap-officeap-radio-2] service-template 1 vlan-group roam
[AC-wlan-ap-officeap-radio-2] radio enable
2. 配置AC2
(1) 在AC2上配置相关VLAN和对应虚接口地址,并放通对应接口。
(2) 配置vlan-group,给客户端分配vlan 10,20,30,40。
[AC] vlan-group roam
[AC-vlan-group-roam] vlan-list 10 20 30 40
(3) 配置服务模板。
# 创建无线服务模板1,并进入无线服务模板视图。
[AC] wlan service-template 1
[AC-wlan-st-1] ssid service
# 配置给客户端分配的VLAN为静态模式。
[AC-wlan-st-1] client vlan-alloc static
[AC-wlan-st-1] service-template enable
(4) 配置AP,调用服务模板的同时调用vlan-group。
[AC] wlan ap officeap2 model WA4320i-ACN
[AC-wlan-ap-officeap] serial-id 210235A1GQC152001023
[AC-wlan-ap-officeap] radio 2
[AC-wlan-ap-officeap-radio-2] service-template 1 vlan-group roam
[AC-wlan-ap-officeap-radio-2] radio enable
3. 配置Switch
# 创建相关VLAN,配置L2 switch和AP相连的接口为Trunk类型,PVID为AP 管理VLAN,AP、无线客户端Client通过DHCP server自动获取IP地址,并开启PoE供电功能。
3 验证配置
# AC1和AC2查看客户端的VLAN和IP地址是一样的,说明漫游成功了。
# 在AC1上使用display wlan client命令可以看到Client的IP地址和VLAN。
[AC] display wlan client
Total number of clients: 1
MAC address User name AP name RID IP address IPv6 address VLAN
68db-ca64-23fd N/A officeap 1 192.168.10.2 10
# 在AC2上使用display wlan client命令可以看到Client的IP地址和VLAN。
[AC] display wlan client
Total number of clients: 1
MAC address User name AP name RID IP address IPv6 address VLAN
(0)
如图1所示,Switch作为DHCP服务器为AP和Client分配IP地址,在AC上配置两个VLAN组,VLAN-group test1和VLAN-group test2。现要求:Client分别接入不同VLAN组,VLAN组可以为Client随机分配组内的VLAN,使Client被均衡地分配在所有VLAN中。
图1 VLAN-group为Client静态分配VLAN组网图
设备 | 接口 | IP地址 | 设备 | 接口 | IP地址 |
AC | Vlan-int2 | 192.12.0.2/16 | Switch | Vlan-int2 | 192.12.0.1/16 |
| Vlan-int10 | 192.10.0.2/16 |
| Vlan-int10 | 192.10.0.1/16 |
| Vlan-int20 | 192.20.0.2/16 |
| Vlan-int20 | 192.20.0.1/16 |
| Vlan-int30 | 192.30.0.2/16 |
| Vlan-int30 | 192.30.0.1/16 |
| Vlan-int40 | 192.40.0.2/16 |
| Vlan-int40 | 192.40.0.1/16 |
(1) 配置AC的接口
# 创建VLAN 2及其对应的VLAN接口,并为该接口配置IP地址192.12.0.2/16。AP将获取该IP地址与AC建立CAPWAP隧道。
<AC> system-view
[AC] vlan 2
[AC-vlan2] quit
[AC] interface vlan-interface 2
[AC-Vlan-interface2] ip address 192.12.0.2 16
[AC-Vlan-interface2] quit
# 创建VLAN 10作为客户端接入的业务VLAN,并为该接口配置IP地址192.10.0.2/16。
[AC] vlan 10
[AC-vlan10] quit
[AC] interface vlan-interface 10
[AC-Vlan-interface10] ip address 192.10.0.2 16
[AC-Vlan-interface10] quit
# 创建VLAN 20作为客户端接入的业务VLAN,并为该接口配置IP地址192.20.0.2/16。
[AC] vlan 20
[AC-vlan20] quit
[AC] interface vlan-interface 20
[AC-Vlan-interface20] ip address 192.20.0.2 16
[AC-Vlan-interface20] quit
# 创建VLAN 30作为客户端接入的业务VLAN,并为该接口配置IP地址192.30.0.2/16。
[AC] vlan 30
[AC-vlan30] quit
[AC] interface vlan-interface 30
[AC-Vlan-interface30] ip address 192.30.0.2 16
[AC-Vlan-interface30] quit
# 创建VLAN 40作为客户端接入的业务VLAN,并为该接口配置IP地址192.40.0.2/16。
[AC] vlan 40
[AC-vlan40] quit
[AC] interface vlan-interface 40
[AC-Vlan-interface40] ip address 192.40.0.2 16
[AC-Vlan-interface40] quit
# 将与Switch相连的接口GigabitEthernet 1/0/1的链路类型配置为Trunk,并允许VLAN 2、VLAN 10、VLAN 20、VLAN 30和VLAN 40通过。
[AC] interface gigabitethernet 1/0/1
[AC-GigabitEthernet1/0/1] port link-type trunk
[AC-GigabitEthernet1/0/1] port trunk permit vlan 2 10 20 30 40
[AC-GigabitEthernet1/0/1] quit
(2) 配置VLAN-group
# 创建VLAN-group test1,为客户端分配VLAN 10和VLAN 20。
[AC] vlan-group test1
[AC-vlan-group-test1] vlan-list 10 20
# 创建VLAN-group test2,为客户端分配VLAN 30和VLAN 40。
[AC] vlan-group test2
[AC-vlan-group-test2] vlan-list 30 40
(3) 配置无线接入服务
# 创建无线服务模板1并进入无线服务模板视图。
[AC] wlan service-template 1
# 配置无线服务的SSID为service。
[AC-wlan-st-1] ssid service
# 配置给客户端分配的VLAN为静态模式,客户端首次上线被随机分配VLAN-group中的VLAN,再次上线时VLAN保持不变。
[AC-wlan-st-1] client vlan-alloc static
当配置客户端的VLAN分配方式为动态模式时,会出现客户端无法主动更换地址,导致连接断开的情况,请配置VLAN分配方式为静态模式。
# 开启无线服务模板。
[AC-wlan-st-1] service-template enable
[AC-wlan-st-1] quit
(4) 配置AP
# 创建手工AP,配置AP名称为ap1,型号为WA5320,序列号为219801A0YDC14C000225。
[AC] wlan ap ap1 model WA5320
[AC-wlan-ap-ap1] serial-id 219801A0YDC14C000225
# 进入ap1的Radio 1视图,并将无线服务模板1绑定到Radio 1上,同时指定VLAN-group。
[AC-wlan-ap-ap1] radio 1
[AC-wlan-ap-ap1-radio-1] service-template 1 vlan-group test1
# 开启Radio 1的射频功能。
[AC-wlan-ap-ap1-radio-1] radio enable
[AC-wlan-ap-ap1-radio-1] quit
[AC-wlan-ap-ap1] quit
# 创建手工AP,配置AP名称为ap2,型号为WA5320,序列号为219801A0YDC14C000224。
[AC] wlan ap ap2 model WA5320
[AC-wlan-ap-ap2] serial-id 219801A0YDC14C000224
# 进入ap2的Radio 1视图,并将无线服务模板1绑定到Radio 1上,同时指定VLAN-group。
[AC-wlan-ap-ap2] radio 1
[AC-wlan-ap-ap2-radio-1] service-template 1 vlan-group test2
# 开启Radio 1的射频功能。
[AC-wlan-ap-ap2-radio-1] radio enable
[AC-wlan-ap-ap2-radio-1] quit
[AC-wlan-ap-ap2] quit
(1) 配置Switch的接口
# 创建VLAN 2及其对应的VLAN接口,并为该接口配置IP地址192.12.0.1/16。
<Switch> system-view
[Switch] vlan 2
[Switch-vlan2] quit
[Switch] interface vlan-interface 2
[Switch-Vlan-interface2] ip address 192.12.0.1 16
[Switch-Vlan-interface2] quit
# 创建VLAN 10及其对应的VLAN接口,并为该接口配置IP地址192.10.0.1/16。
[Switch] vlan 10
[Switch-vlan10] quit
[Switch] interface vlan-interface 10
[Switch-Vlan-interface10] ip address 192.10.0.1 16
[Switch-Vlan-interface10] quit
# 创建VLAN 20及其对应的VLAN接口,并为该接口配置IP地址192.20.0.1/16。
[Switch] vlan 20
[Switch-vlan20] quit
[Switch] interface vlan-interface 20
[Switch-Vlan-interface20] ip address 192.20.0.1 16
[Switch-Vlan-interface20] quit
# 创建VLAN 30及其对应的VLAN接口,并为该接口配置IP地址192.30.0.1/16。
[Switch] vlan 30
[Switch-vlan30] quit
[Switch] interface vlan-interface 30
[Switch-Vlan-interface30] ip address 192.30.0.1 16
[Switch-Vlan-interface30] quit
# 创建VLAN 40及其对应的VLAN接口,并为该接口配置IP地址192.40.0.1/16。
[Switch] vlan 40
[Switch-vlan40] quit
[Switch] interface vlan-interface 40
[Switch-Vlan-interface40] ip address 192.40.0.1 16
[Switch-Vlan-interface40] quit
# 将与AC相连的接口GigabitEthernet 1/0/2的链路类型配置为Trunk,并允许VLAN 2、VLAN 10、VLAN 20、VLAN 30和VLAN 40通过。
[Switch] interface gigabitethernet 1/0/2
[Switch-GigabitEthernet1/0/2] port link-type trunk
[Switch-GigabitEthernet1/0/2] port trunk permit vlan 2 10 20 30 40
[Switch-GigabitEthernet1/0/2] quit
(2) 配置DHCP服务器
# 开启DHCP功能。
[Switch] dhcp enable
# 创建DHCP地址池vlan2,为AP动态分配网段为192.2.0.0/16,网关地址为192.2.0.1。
[Switch] dhcp server ip-pool vlan2
[Switch-dhcp-pool-vlan2] network 192.12.0.0 mask 255.255.0.0
[Switch-dhcp-pool-vlan2] gateway-list 192.12.0.1
[Switch-dhcp-pool-vlan2] quit
# 创建DHCP地址池vlan10,为无线客户端动态分配网段为192.10.0.0/16,网关地址为192.10.0.1,为Client分配的DNS服务器地址为网关地址(实际使用过程中请根据实际网络规划配置无线客户端的DNS服务器地址)。
[Switch] dhcp server ip-pool vlan10
[Switch-dhcp-pool-vlan10] network 192.10.0.0 mask 255.255.0.0
[Switch-dhcp-pool-vlan10] gateway-list 192.10.0.1
[Switch-dhcp-pool-vlan10] dns-list 192.10.0.1
[Switch-dhcp-pool-vlan10] quit
# 创建DHCP地址池vlan20,为无线客户端动态分配网段为192.20.0.0/16,网关地址为192.20.0.1,为Client分配的DNS服务器地址为网关地址(实际使用过程中请根据实际网络规划配置无线客户端的DNS服务器地址)。
[Switch] dhcp server ip-pool vlan20
[Switch-dhcp-pool-vlan20] network 192.20.0.0 mask 255.255.0.0
[Switch-dhcp-pool-vlan20] gateway-list 192.20.0.1
[Switch-dhcp-pool-vlan20] dns-list 192.20.0.1
[Switch-dhcp-pool-vlan20] quit
# 创建DHCP地址池vlan30,为无线客户端动态分配网段为192.30.0.0/16,网关地址为192.30.0.1,为Client分配的DNS服务器地址为网关地址(实际使用过程中请根据实际网络规划配置无线客户端的DNS服务器地址)。
[Switch] dhcp server ip-pool vlan30
[Switch-dhcp-pool-vlan30] network 192.30.0.0 mask 255.255.0.0
[Switch-dhcp-pool-vlan30] gateway-list 192.30.0.1
[Switch-dhcp-pool-vlan30] dns-list 192.30.0.1
[Switch-dhcp-pool-vlan30] quit
# 创建DHCP地址池vlan40,为无线客户端动态分配网段为192.40.0.0/16,网关地址为192.40.0.1,为Client分配的DNS服务器地址为网关地址(实际使用过程中请根据实际网络规划配置无线客户端的DNS服务器地址)。
[Switch] dhcp server ip-pool vlan40
[Switch-dhcp-pool-vlan40] network 192.40.0.0 mask 255.255.0.0
[Switch-dhcp-pool-vlan40] gateway-list 192.40.0.1
[Switch-dhcp-pool-vlan40] dns-list 192.40.0.1
[Switch-dhcp-pool-vlan40] quit
# 完成上述配置后,将Client 1和Client 2接入AP 1的无线网络中(SSID:service),通过display wlan client命令查看客户端信息,两个客户端被自动分配至VLAN-group test1下的VLAN 10和VLAN 20中。
[AC]display wlan client
Total number of clients: 2
MAC address User name AP name R IP address VLAN
90f0-528e-0871 N/A ap1 2 192.10.0.3 10
961b-66ea-72c5 N/A ap1 2 192.20.0.3 20
· AC:
#
vlan 2
#
vlan 10
#
vlan 20
#
vlan 30
#
vlan 40
#
vlan-group test1
vlan-list 10 20
#
vlan-group test2
vlan-list 30 40
#
wlan service-template 1
ssid service
client vlan-alloc static
service-template enable
#
interface Vlan-interface2
ip address 192.12.0.2 255.255.0.0
#
interface Vlan-interface10
ip address 192.10.0.2 255.255.0.0
#
interface Vlan-interface20
ip address 192.20.0.2 255.255.0.0
#
interface Vlan-interface30
ip address 192.30.0.2 255.255.0.0
#
interface Vlan-interface40
ip address 192.40.0.2 255.255.0.0
#
interface GigabitEthernet1/0/1
port link-type trunk
port trunk permit vlan 2 10 20 30 40
#
wlan ap ap1 model WA5320
serial-id 219801A0YDC14C000225
radio 1
radio enable
service-template 1 vlan-group test1
#
wlan ap ap2 model WA5320
serial-id 219801A0YDC14C000224
radio 1
radio enable
service-template 1 vlan-group test2
· Switch
#
dhcp enable
#
vlan 2
#
vlan 10
#
vlan 20
#
vlan 30
#
vlan 40
#
dhcp server ip-pool vlan2
gateway-list 192.12.0.1
network 192.12.0.0 mask 255.255.0.0
#
dhcp server ip-pool vlan10
gateway-list 192.10.0.1
network 192.10.0.0 mask 255.255.0.0
dns-list 192.10.0.1
#
dhcp server ip-pool vlan20
gateway-list 192.20.0.1
network 192.20.0.0 mask 255.255.0.0
dns-list 192.20.0.1
#
dhcp server ip-pool vlan30
gateway-list 192.30.0.1
network 192.30.0.0 mask 255.255.0.0
dns-list 192.30.0.1
#
dhcp server ip-pool vlan40
gateway-list 192.40.0.1
network 192.40.0.0 mask 255.255.0.0
dns-list 192.40.0.1
#
interface Vlan-interface2
ip address 192.12.0.1 255.255.0.0
#
interface Vlan-interface10
ip address 192.10.0.1 255.255.0.0
#
interface Vlan-interface20
ip address 192.20.0.1 255.255.0.0
#
interface Vlan-interface30
ip address 192.30.0.1 255.255.0.0
#
interface Vlan-interface40
ip address 192.40.0.1 255.255.0.0
#
interface GigabitEthernet1/0/2
port link-type trunk
port trunk permit vlan 2 10 20 30 40
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论