该接口在输出方向不支持匹配cos

网络工程 cisco-asr 数码管 cos 政策地图
2021-07-17 14:40:48

我有路由器 Cisco ASR 903 ( IOS XE V3.18 )

  ip access-list extended ip-google-traffic
 permit ip 8.8.4.0 0.0.0.255 any
 permit ip 8.8.8.0 0.0.0.255 any
 permit ip 8.34.208.0 0.0.15.255 any
 permit ip 8.35.192.0 0.0.15.255 any
 permit ip 23.236.48.0 0.0.15.255 any
 permit ip 23.251.128.0 0.0.31.255 any
 permit ip 35.184.0.0 0.7.255.255 any
 permit ip 35.192.0.0 0.7.255.255 any
 permit ip 35.200.0.0 0.3.255.255 any
 permit ip 35.204.0.0 0.1.255.255 any
 permit ip 35.224.0.0 0.15.255.255 any
 permit ip 35.240.0.0 0.7.255.255 any
 permit ip 64.9.224.0 0.0.1.255 any
 permit ip 64.9.228.0 0.0.1.255 any
 permit ip 64.15.112.0 0.0.15.255 any
 permit ip 64.233.160.0 0.0.31.255 any
 permit ip 66.102.0.0 0.0.15.255 any
 permit ip 66.249.64.0 0.0.31.255 any

** 我将 vlan 2528 上的所有流量与 ACL IP-GOOGLE-TRAFFIC 匹配

 class-map match-all google
 match access-group name ip-google-traffic



  policy-map google-cap
     class google
     set cos 3


interface Port-channel2
 description To-MTS-BE02
 mtu 9000
 no ip address
 service instance 2528 ethernet
  encapsulation dot1q 2528
  rewrite ingress tag pop 1 symmetric
  service-policy input google-cap
  bridge-domain 2528
 !
 service instance 2529 ethernet
 !
!

** 现在我在接口 0/0/2 上有实例 955 的 CUST,我需要限制谷歌和默认的流量

 class-map match-all GGC-OUT
   match cos  3
   !


policy-map Cust1
 class GGC-OUT
  police cir 5000000000
 class class-default
  police cir 1750000000
!
!

** 现在将策略应用于 Cust1 实例

#interface ten 0/0/6
#service instance 955 ethernet 
serivce-policy output Cust1

我收到此 msg 错误 Match cos is not supported for this interface in the output direction。 或者,如果我使用 DSCP,我会收到此 msg Match DSCP in IPv4/IPv6 数据包不支持此接口

所以任何想法都可以限制 ASR 903 上我的客户的谷歌和默认流量

1个回答

我找到了一种成功的方法来在CISCO ASR 903 IOS XE 3.18S上对指定 ip 的流量进行策略管理

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

1-subnet 从 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-创建策略映射到我们的类映射

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 的 74.0.0.0/8 和其他 90M 的流量为 40 M,如果您有更多的 cust 只需创建另一个带有 ACL、CLASS 的 ip 访问列表,然后将新类添加到策略映射 TRAFFIC-LIMTED