PBR
-
建立acl允许匹配的流(IP)
acl adv number 3500
rule 0 permit source 192.168.1.0 0.0.0.255
-
定义PBR关联及动作
policy-based-route PBR permit node 5
if-match acl 3500
apply ip-address next-hop 192.168.100.1
注:node 为策略路由优先级数值越小优先匹配
-
启用本地策略路由
ip local policy-based-route PBR
注:默认情况未启用,若不启用策略路由不生效,本地策略路由只对设备本身产生的报文生效。
-
接口应用
interface Vlan-interface1
ip address 192.168.200.0 255.255.255.0
ip policy-based-route PBR
QOS策略转发
-
# 定义基本ACL 2001,对源IP地址为2.1.1.2的报文进行分类。
acl number 2001
rule permit source 2.1.1.2 0
quit
-
# 定义类classifier_1,匹配基本ACL 2000。
traffic classifier classifier_1
if-match acl 2000
quit
-
# 定义流行为behavior_1,动作为重定向至200.1.1.2。
traffic behavior behavior_1
redirect next-hop 200.1.1.2 # 不支持next-hop可指定下一跳接口
quit
-
# 定义策略policy,为类classifier_1指定流行为behavior_1。
qos policy policy
classifier classifier_1 behavior behavior_1
quit
-
# 将策略policy应用到端口GigabitEthernet 1/0/1的入方向上。
interface GigabitEthernet 1/0/1
qos apply policy policy inbound