小乔 发表于 2019-4-25 15:07:55

华为设备配置QOS对内网IP限速

组网需求RouterA部署在企业网的出口处,企业用户通过2个不同的网段连接到RouterA从而访问服务器222.1.1.1/24。现要求控制企业网内部用户192.168.10.0/24对服务器的访问,速率限制为64kbit/s。
图1 配置基于内网IP进行限速的组网图


操作步骤
RouterA的配置
#
sysname RouterA
#
vlan batch 10 20
#
acl number 3001//配置编号为3001的编号型访问控制列表
rule 5 permit ip source 192.168.10.0 0.0.0.255//配置规则5,允许源地址为192.168.10.0网段的报文通过
rule 10 permit ip source 192.168.20.0 0.0.0.255//配置规则10,允许源地址为192.168.20.0网段的报文通过
acl number 3002//配置编号为3002的编号型访问控制列表
rule 5 permit ip source 192.168.10.0 0.0.0.255//配置规则5,允许源地址为192.168.10.0网段的报文通过
#
qos queue-profile limit//创建队列模板limit
queue 3 gts cir 64 cbs 1600//配置队列3的承诺信息速率为64kbit/s
#
traffic classifier c1 operator or
if-match acl 3002//配置流分类c1:匹配规则为ACL 3002
#
traffic behavior b1
remark local-precedence af3//配置流行为b1:对匹配流分类的报文重标记本地优先级为AF3,不指定流行为为permit或deny时,默认为permit。
#
traffic policy p1
classifier c1 behavior b1//配置流策略p1:绑定流分类c1与流行为b1
#
interface Vlanif10
ip address 192.168.10.1 255.255.255.0
#
interface Vlanif20
ip address 192.168.20.1 255.255.255.0
#
interface Ethernet2/0/0
port link-type trunk//配置接口的链路类型为Trunk
port trunk allow-pass vlan 10 20//配置Trunk类型接口加入vlan 10和vlan 20
traffic-policy p1 inbound//在接口入方向上应用流策略p1
#
interface GigabitEthernet3/0/0
ip address 222.0.1.1 255.255.255.0
qos queue-profile limit//在接口上应用队列模板limit
nat outbound 3001//在接口上对匹配ACL 3001的报文做NAT
#
ip route-static 0.0.0.0 0.0.0.0 222.0.1.2
#

验证配置结果
# 执行display qos queue statistics interface gigabitethernet 3/0/0命令检查GE3/0/0接口上应用了队列模板limit后的报文统计信息,可以看到接口3号队列的输出速率被限制在规定范围内,队列满后,无法缓存的报文被丢弃。

配置注意事项
请配置Switch与不同的网段用户对接的接口为Access类型接口,并将其加入对应VLAN。
请配置Switch与RouterA对接的接口为Trunk类型接口,并加入对应VLAN。


depoi2014 发表于 2019-4-26 09:57:04

谢谢楼主分享

wsfred 发表于 2019-5-23 17:10:41

多谢分享

liyou60 发表于 2024-7-5 11:00:22

华   值    {:6_264:}{:6_265:}{:6_267:}{:6_268:}
为   得    {:6_269:}{:6_273:}{:6_276:}{:6_277:}
认   拥    {:6_278:}{:6_280:}{:6_282:}{:6_283:}
证   有    {:6_285:}{:6_289:}{:6_290:}{:6_291:}
,   !    {:6_295:}{:6_298:}{:6_299:}{:6_301:}

liyou60 发表于 2024-7-5 11:00:30

华   值    {:6_264:}{:6_265:}{:6_267:}{:6_268:}
为   得    {:6_269:}{:6_273:}{:6_276:}{:6_277:}
认   拥    {:6_278:}{:6_280:}{:6_282:}{:6_283:}
证   有    {:6_285:}{:6_289:}{:6_290:}{:6_291:}
,   !    {:6_295:}{:6_298:}{:6_299:}{:6_301:}

hanscoffee 发表于 2025-7-23 16:11:46

好东西谢谢楼主分享
页: [1]
查看完整版本: 华为设备配置QOS对内网IP限速