此接口不支持在 IPv4/IPv6 数据包中匹配 DSCP

网络工程 思科 服务质量 ios-xe 服务政策
2021-07-20 09:28:50

我有 cisco asr 903 (ios xe) 我需要限制 google-traffic 的流量这是我的配置

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

class-map match-all google
 match access-group name ip-google-traffic
class-map match-all GGC-OUT
 match dscp af22
!
policy-map google-cap
 class google
  set ip dscp af22
policy-map Softlink
 class GGC-OUT
  police cir 5000000000
 class class-default
  police cir 1750000000 
INTERFACE TEN 0/0/3
service instance 2528 ethernet
  encapsulation dot1q 2528
  rewrite ingress tag pop 1 symmetric
  service-policy input google-cap
  bridge-domain 2528
 !

现在,当尝试应用我的客户实例的策略时,我收到 msg 错误

INTERFACE TEN 0/0/3
FiberISP-Cisco(config-if-srv)#service instance 2528 ethernet
FiberISP-Cisco(config-if-srv)#service-policy out Cust
Match DSCP in IPv4/IPv6 packets is not supported for this interfac
 !

为什么?

2个回答

我找到了一种成功的方法来在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

DSCP 将是 IP 报头的一部分,因此由第 3 层接口处理。由于您有一个 L2 以太网接口,您应该使用 CoS 对您的流量进行分类,因为它不关心也不能操纵 IP 标头。

文档将很好地概述如何在类映射和策略映射中使用 CoS。

根据您提供的配置,它会是这样的。

class-map match-all GGC-OUT
match cos 3
!
policy-map google-cap
 class google
  set cos 3