无法匹配输出策略映射中的 ACL

网络工程 思科 服务质量 ios-xe 政策地图 类图
2022-02-19 20:55:28

这是我的配置,

access-list 2000 permit ip 8.8.8.0 0.0.0.255 any
access-list 2000 permit ip 8.34.208.0 0.0.15.255 any
access-list 2000 permit ip 8.35.192.0 0.0.15.255 any
access-list 2000 permit ip 23.236.48.0 0.0.15.255 any
access-list 2000 permit ip 35.240.0.0 0.7.255.255 any
access-list 2000 permit ip 64.9.224.0 0.0.1.255 any
access-list 2000 permit ip 64.9.228.0 0.0.1.255 any
access-list 2000 permit ip 64.15.112.0 0.0.15.255 any
access-list 2000 permit ip 64.233.160.0 0.0.31.255 any


class-map match-any google-traffic
 match access-group 2000
!         
policy-map 528
 class class-default
  shape average 3200000000 

interface TenGigabitEthernet0/0/1
 description Cust-1
 no ip address          
 service instance 528 ethernet
  description Ramy
  encapsulation dot1q 528
  rewrite ingress tag pop 1 symmetric
  service-policy output 528
  bridge-domain 528
 !        
! 

现在一切正常

我需要在我的政策 528 上使用类 google-traffic 我收到错误

FiberISP-Cisco(config)#policy-map 528
FiberISP-Cisco(config-pmap)#class google-traffic
QoS: Configuration failed. Can NOT match ACL in an output policy-map
2个回答

对于您的 ASR 903,使用 ACL 仅限于入口策略。请参阅Cisco ASR 900 路由器系列的服务质量配置指南

仅入口流量支持 QoS ACL

您可以创建一个入口策略来监管或标记与 ACL 匹配的流量,然后,如果已标记,您可以对出口进行整形或监管。您可能只是想监管传入的流量,然后在将其丢弃到出口之前,您不需要不必要地路由/切换它。


编辑:

如果您知道客户的地址或网络,则路由器资源的最佳使用方式是通过将流量监管到所需速率来解决入口接口处的问题。这只会影响从您的 Google 地址发往客户地址/网络的流量:

access-list 2000 permit ip 8.8.8.0 0.0.0.255 <customer network> <customer wildcard>
access-list 2000 permit ip 8.34.208.0 0.0.15.255 <customer network> <customer wildcard>
access-list 2000 permit ip 8.35.192.0 0.0.15.255 <customer network> <customer wildcard>
access-list 2000 permit ip 23.236.48.0 0.0.15.255 <customer network> <customer wildcard>
access-list 2000 permit ip 35.240.0.0 0.7.255.255 <customer network> <customer wildcard>
access-list 2000 permit ip 64.9.224.0 0.0.1.255 <customer network> <customer wildcard>
access-list 2000 permit ip 64.9.228.0 0.0.1.255 <customer network> <customer wildcard>
access-list 2000 permit ip 64.15.112.0 0.0.15.255 <customer network> <customer wildcard>
access-list 2000 permit ip 64.233.160.0 0.0.31.255 <customer network> <customer wildcard>
!
class-map match-any From_Google_to_Customer_X
 match access-group 2000
!         
policy-map From_Google_to_Customer_X
 class From_Google_to_Customer_X
  police 8000 1000 1000 conform-action transmit exceed-action set-qos-transmit 1 violate-action drop
!
interface <input interface>
 service policy input From_Google_to_Customer_X
!

您可以更改网络、价值观和行动以适应您的特定情况。你没有在你的问题中提供足够的信息来给你一个很好的例子。

请记住,同时具有源地址和目标地址的东西(例如扩展 ACL)应尽可能靠近源应用,以避免不必要地路由注定要丢弃的流量,这将浪费路由器资源。

我找到了一种成功的方法来策略指定 ip 的流量,或者在CISCO ASR 903 IOS XE 3.18S 上

例如,我有一些服务的 ip 74.0.0.0/8(如谷歌)

1-子网从 1.0.0.0/8 到 255.0.0.0/8 的完整范围,并自定义您想要的 ip('s) 在此处输入链接描述

2-现在你有两个范围

1.0.0.0/8   
2.0.0.0/7
4.0.0.0/6   
8.0.0.0/5   
16.0.0.0/4  
32.0.0.0/3  
64.0.0.0/5  
72.0.0.0/8
74.0.0.0/8  (this we need to policy )
75.0.0.0/8
75.0.0.0/8  
76.0.0.0/6  
80.0.0.0/4
96.0.0.0/3  
128.0.0.0/1

3-创建对象组

#object-group network object_ip_select
      74.0.0.0/8 




 #object-group network object_ip_other
            1.0.0.0/8   
            2.0.0.0/7
            4.0.0.0/6   
            8.0.0.0/5   
            16.0.0.0/4  
            32.0.0.0/3  
            64.0.0.0/5  
            72.0.0.0/
            75.0.0.0/8
            75.0.0.0/8  
            76.0.0.0/6  
            80.0.0.0/4
            96.0.0.0/3  
            128.0.0.0/1

4-为 Cust 创建访问列表并选择一个 dst-address 作为 Cust ip

#ip access-list extended ACL-CUST1-IP-SELECT
 #permit ip object-group object_ip_select <CUSTNETWORK> <WILDCARD>

#ip access-list extended ACL-CUST1-IP-OTHER
 #permit ip object-group object_ip_other <CUSTNETWORK> <WILDCARD>

5-为 ip-select 和其他 ips 创建两个策略映射

 #class-map match-all CLASS-CUST1-IP-SELECT
 #match access-group name ACL-CUST1-IP-SELECT


 #class-map match-all CLASS-CUST1-IP-OTHER
 #match access-group name ACL-CUST1-IP-OTHER

6-为我们的 CLASS-MAP 创建策略映射

policy-map TRAFFIC-LIMTED
 class CLASS-CUST1-IP-SELECT
  police cir 40M
 class CLASS-CUST1-IP-OTHER
  police cir 90M

7-将此策略映射应用于传入接口或实例(vlan)

interface Port-channel2
 service instance 2000 ethernet
  service-policy input TRAFFIC-LIMTED

8-现在完成了 cust 1 的流量为 40 M 用于 74.0.0.0/8 和其他 90M 如果您有更多的 cust 只需使用 ACL、CLASS 创建另一个 ip 访问列表,然后将新类添加到策略映射 TRAFFIC-LIMTED