配置有线无线用户授权HQoS示例
组网需求
- 如果存在视频点播等业务,需要避免AP缓存溢出。
- 指定通过认证的用户为VIP用户。
- 已知用户2的IP地址为192.168.10.1,需要保证该有线用户发送和接收的报文始终得到优先调度。
- 优先保证语音业务的带宽,其次是视频业务,最后是文件传输业务。具体配置参数如表1所示。
配置注意事项
- 仅S12700E的X6H系列单板支持本示例。
- 本示例主要介绍授权HQoS的相关配置,NAC和WLAN基本业务的配置这里不做相关说明。
- 本示例仅支持使用统一模式部署NAC功能,详细配置过程请参见《S12700, S12700E V200R019C10 配置指南-用户接入与认证》 NAC配置(统一模式)。
- WLAN基本业务的详细配置过程请参见《S12700, S12700E V200R019C10 配置指南-WLAN-AC》 WLAN基本业务配置。
- AC下行到AP的流量整形功能需要在AP上线前开启,否则相关配置将不生效。
无线用户中,仅数据转发方式为隧道转发且获取地址后的IPv4用户支持授权属性HW-Subscriber-QoS-Profile。
已经被授权属性HW-Subscriber-QoS-Profile的用户,不支持通过重认证方式删除该授权。
配置思路
- 在AP上线前,开启AC下行到AP的流量整形功能。SwitchA通过和AP的协商,对转发给AP的流量进行整形。
- 创建VLAN,并配置各接口,使用户能够通过SwitchA访问网络。
- 通过业务方案授权,指定通过认证的用户为VIP用户,优先调度用户2收发的报文:
- 配置SwitchA与RADIUS服务器的对接参数。
- 配置AAA方案,指定认证、授权和计费方式。
- 配置SAC模板,重标记用户2发送和接收的报文的内部优先级。
- 将SAC模板绑定到业务方案中,并在业务方案中配置用户的优先级为1。
- 在域下绑定AAA方案、业务方案和RADIUS服务器模板。
- 通过QoS模板配置用户队列,通过RADIUS服务器授权相关RADIUS属性,实现HQoS调度:
- 配置DiffServ域,将802.1p优先级映射为PHB行为并为报文着色。
- 配置流队列模板及相关参数,以实现为不同的业务提供不同的调度优先级和丢弃参数。
- 在QoS模板中配置用户队列,在用户队列中引用流队列模板。
- 通过RADIUS服务器授权编号为26-17的华为RADIUS扩展属性HW-Subscriber-QoS-Profile。
操作步骤
- 开启AC下行到AP的流量整形功能
# 为防止SwitchA转发给AP的突发流量引起AP缓存溢出,可以开启本功能,使SwitchA对转发给AP的流量进行整形,从而缓解AP的压力。
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] wlan [SwitchA-wlan-view] ap auto-shaping enable [SwitchA-wlan-view] quit
- 创建VLAN并配置各接口
# 创建VLAN100、VLAN200和VLAN1000。配置接口25GE1/0/1、25GE1/0/2和25GE1/0/3的接口类型为Access,并分别加入VLAN100、VLAN200和VLAN1000。
[SwitchA] vlan batch 100 200 1000 [SwitchA] interface 25ge 1/0/1 [SwitchA-25GE1/0/1] port link-type access [SwitchA-25GE1/0/1] port default vlan 100 [SwitchA-25GE1/0/1] quit [SwitchA] interface 25ge 1/0/2 [SwitchA-25GE1/0/2] port link-type access [SwitchA-25GE1/0/2] port default vlan 200 [SwitchA-25GE1/0/2] quit [SwitchA] interface 25ge 1/0/3 [SwitchA-25GE1/0/3] port link-type access [SwitchA-25GE1/0/3] port default vlan 1000 [SwitchA-25GE1/0/3] quit [SwitchA] interface vlanif 100 [SwitchA-Vlanif100] ip address 192.168.9.2 24 [SwitchA-Vlanif100] quit [SwitchA] interface vlanif 200 [SwitchA-Vlanif200] ip address 192.168.10.2 24 [SwitchA-Vlanif200] quit [SwitchA] interface vlanif 1000 [SwitchA-Vlanif1000] ip address 192.168.11.2 24 [SwitchA-Vlanif1000] quit
- 配置业务方案授权
# 配置RADIUS服务器模板“tem_rad”,指定SwitchA与RADIUS服务器的对接参数。包括RADIUS认证服务器和RADIUS计费服务器的IP地址、端口号和共享密钥。
[SwitchA] radius-server template tem_rad [SwitchA-radius-tem_rad] radius-server authentication 192.168.11.1 1812 [SwitchA-radius-tem_rad] radius-server accounting 192.168.11.1 1813 [SwitchA-radius-tem_rad] radius-server shared-key cipher Admin@123 [SwitchA-radius-tem_rad] quit [SwitchA] radius-server authorization 192.168.11.1 shared-key cipher Admin@123
# 配置AAA方案,指定认证和计费方式均为RADIUS,计费时间间隔为15分钟。
[SwitchA] aaa [SwitchA-aaa] authentication-scheme auth [SwitchA-aaa-authen-auth] authentication-mode radius [SwitchA-aaa-authen-auth] quit [SwitchA-aaa] accounting-scheme acco [SwitchA-aaa-accounting-acco] accounting-mode radius [SwitchA-aaa-accounting-acco] accounting realtime 15 [SwitchA-aaa-accounting-acco] quit [SwitchA-aaa] quit
# 重标记有线用户(用户2)发送和接收的报文的内部优先级。在SAC模板中配置基于用户ACL的重标记内部优先级,使设备根据重标记后的优先级对匹配ACL的报文进行调度。
[SwitchA] acl 6000 [SwitchA-acl-ucl-6000] rule permit ip source 192.168.10.1 0 [SwitchA-acl-ucl-6000] rule permit ip destination 192.168.10.1 0 [SwitchA-acl-ucl-6000] quit [SwitchA] sac-profile name sac1 [SwitchA-sac-profile-sac1] acl 6000 remark local-precedence 7 [SwitchA-sac-profile-sac1] quit
# 创建业务方案,将SAC模板绑定到业务方案中,并在业务方案中配置用户的优先级为1。缺省情况下,用户的优先级为0,用户为普通用户。若配置用户的优先级为1,则用户为VIP用户。
[SwitchA] aaa [SwitchA-aaa] service-scheme srvscheme1 [SwitchA-aaa-service-srvscheme1] sac-profile sac1 [SwitchA-aaa-service-srvscheme1] priority 1 [SwitchA-aaa-service-srvscheme1] quit
# 配置域“huawei.com”,在域下绑定AAA方案、业务方案和RADIUS服务器模板。
[SwitchA-aaa] domain huawei.com [SwitchA-aaa-domain-huawei.com] authentication-scheme auth [SwitchA-aaa-domain-huawei.com] accounting-scheme acco [SwitchA-aaa-domain-huawei.com] radius-server tem_rad [SwitchA-aaa-domain-huawei.com] service-scheme srvscheme1 [SwitchA-aaa-domain-huawei.com] quit [SwitchA-aaa] quit
- 通过QoS模板配置用户队列
# 配置优先级映射。创建DiffServ域ds1,将802.1p优先级6、5、2分别映射为服务等级EF、AF3、AF1,并分别将报文标记为绿色、黄色和红色。
[SwitchA] diffserv domain ds1 [SwitchA-dsdomain-ds1] 8021p-inbound 6 phb ef green [SwitchA-dsdomain-ds1] 8021p-inbound 5 phb af3 yellow [SwitchA-dsdomain-ds1] 8021p-inbound 2 phb af1 red [SwitchA-dsdomain-ds1] quit [SwitchA] interface 25ge 1/0/1 [SwitchA-25GE1/0/1] trust upstream ds1 [SwitchA-25GE1/0/1] trust 8021p inner [SwitchA-25GE1/0/1] quit [SwitchA] interface 25ge 1/0/2 [SwitchA-25GE1/0/2] trust upstream ds1 [SwitchA-25GE1/0/2] trust 8021p inner [SwitchA-25GE1/0/2] quit
# 配置流队列WRED模板wred1,并配置wred1的三色报文参数。
[SwitchA] flow-wred-profile wred1 [SwitchA-flow-wred-wred1] color green low-limit 80 high-limit 100 discard-percentage 10 [SwitchA-flow-wred-wred1] color yellow low-limit 60 high-limit 80 discard-percentage 20 [SwitchA-flow-wred-wred1] color red low-limit 40 high-limit 60 discard-percentage 40 [SwitchA-flow-wred-wred1] quit
# 配置流队列模板flow1引用流队列WRED模板wred1,并配置各服务等级的调度参数。
[SwitchA] flow-queue-profile flow1 [SwitchA-flow-queue-flow1] qos queue 5 pq flow-wred-profile wred1 [SwitchA-flow-queue-flow1] qos queue 3 wfq weight 20 flow-wred-profile wred1 [SwitchA-flow-queue-flow1] qos queue 1 wfq weight 10 flow-wred-profile wred1 [SwitchA-flow-queue-flow1] quit
# 在QoS模板中创建用户队列,在用户队列中引用流队列模板。
[SwitchA] qos-profile name qos1 [SwitchA-qos-qos1] user-queue flow-queue-profile flow1 [SwitchA-qos-qos1] quit [SwitchA] quit
# 通过RADIUS服务器,为域“huawei.com”中认证成功的用户授权编号为26-17的华为RADIUS扩展属性HW-Subscriber-QoS-Profile。授权的属性值是QoS模板的名称qos1。
- 验证配置结果
# 查看流队列WRED模板的配置信息,包括红、黄、绿三色报文的丢弃上下限和最大丢弃概率。
<SwitchA> display flow-wred-profile name wred1 Flow-wred-profile[1]: wred1 Queue depth : 1048576 Color Low-limit High-limit Discard-percentage - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Green 80 100 10 Yellow 60 80 20 Red 40 60 40 -----------------------------------------------------------------
# 查看流队列模板的配置信息,包括WFQ调度的权重。
<SwitchA> display flow-queue-profile name flow1 Flow-queue-profile[1]: flow1 Queue Schedule(Weight) Shaping flow-wred-profile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 PQ None default 1 WFQ(10) None wred1 2 PQ None default 3 WFQ(20) None wred1 4 PQ None default 5 PQ None wred1 6 PQ None default 7 PQ None default -----------------------------------------------------------------------
# 查看SAC模板配置信息,包括用户ACL的编号和对应的重标记内部优先级的值。
<SwitchA> display sac-profile name sac1 -------------------------- ACL Id Local-precedence -------------------------- 6000 7 -------------------------- Total: 1
# 查看业务方案配置信息,包括业务方案下用户的优先级。
<SwitchA> display service-scheme name srvscheme1 service-scheme-name : srvscheme1 service-scheme-primary-dns : - service-scheme-secondary-dns : - service-scheme-adminlevel : - service-scheme-dhcpgroup : - service-scheme-ippool : - service-scheme-primary-wins : - service-scheme-secondary-wins : - service-scheme-redirect-acl-id : - service-scheme-v6-redirect-acl-id: - service-scheme-priority : 1 access-limit-username-maxnum : - service-scheme-qosprofile : - service-shceme-sacprofile : - service-scheme-idlecut : -
# 查看域的配置信息,包括域使用的认证方案、计费方案、业务方案和RADIUS服务器模板名称。
<SwitchA> display domain name huawei.com Domain-name : huawei.com Domain-index : 6 Domain-state : Active Authentication-scheme-name : auth Accounting-scheme-name : acco Authorization-scheme-name : - Service-scheme-name : srvscheme1 RADIUS-server-template : tem_rad Accounting-copy-RADIUS-template : - HWTACACS-server-template : - HACA-server-template : - Push-url-address : - Accounting-DualStack-Separate : - Flow-statistic : - Tariff-level : -
配置文件
SwitchA的配置文件
# sysname SwitchA # vlan batch 100 200 1000 # diffserv domain ds1 8021p-inbound 2 phb af1 red 8021p-inbound 5 phb af3 yellow 8021p-inbound 6 phb ef green # radius-server template tem_rad radius-server shared-key cipher %^%#-_QJF_J/K7_x`[%C)+z)`rMaW,tdL8O6S%'BCcu@%^%# radius-server authentication 192.168.11.1 1812 weight 80 radius-server accounting 192.168.11.1 1813 weight 80 radius-server authorization 192.168.11.1 shared-key cipher %^%#i7Y,+sQjQ<o,o4"gy+TNgGvt*`-v#RW)B@Ri}!}3%^%# # acl number 6000 rule 5 permit ip source 192.168.10.1 0 rule 10 permit ip destination 192.168.10.1 0 # sac-profile name sac1 acl 6000 remark local-precedence 7 # flow-wred-profile wred1 color green low-limit 80 high-limit 100 discard-percentage 10 color yellow low-limit 60 high-limit 80 discard-percentage 20 color red low-limit 40 high-limit 60 discard-percentage 40 # flow-queue-profile flow1 qos queue 1 wfq weight 10 flow-wred-profile wred1 qos queue 3 wfq weight 20 flow-wred-profile wred1 qos queue 5 flow-wred-profile wred1 # qos-profile name qos1 user-queue flow-queue-profile flow1 # aaa authentication-scheme auth authentication-mode radius accounting-scheme acco accounting-mode radius accounting realtime 15 service-scheme srvscheme1 priority 1 sac-profile sac1 domain huawei.com authentication-scheme auth accounting-scheme acco service-scheme srvscheme1 radius-server tem_rad # interface Vlanif100 ip address 192.168.9.2 255.255.255.0 # interface Vlanif200 ip address 192.168.10.2 255.255.255.0 # interface Vlanif1000 ip address 192.168.11.2 255.255.255.0 # interface 25GE1/0/1 port link-type access port default vlan 100 trust upstream ds1 trust 8021p inner # interface 25GE1/0/2 port link-type access port default vlan 200 trust upstream ds1 trust 8021p inner # interface 25GE1/0/3 port link-type access port default vlan 1000 # return