对从GE3/1/2接口进来的源IP为2.2.2.2的IP报文,从接口GE3/1/2出去,源IP为3.3.3.3的IP报文,从接口GE3/1/3出去。
图1 Redirect配置组网图
l 配置acl 3000,匹配源ip为2.2.2.2的数据流
l 配置acl 3001,匹配源IP为3.3.3.3的数据
l
配置流分类redirect_class_1,匹配acl 3000
l
配置流分类redirect_class_2,匹配acl 3001
l
配置流行为redirect_class_1,动作为redirect
l
配置流行为redirect_class_2,动作为redirect
l
配置QoS策略redirect_policy,绑定流分类和流行为
l
将QoS策略下发到端口GE3/1/1
#
定义ACL 3000,匹配源ip为2.2.2.2的数据流
[H3C]
acl number 3000
[H3C-acl-adv-3000]
rule 0 permit ip source 2.2.2.2 0
#
定义ACL 3001,匹配源ip为3.3.3.3的数据流
[H3C]
acl number 3001
[H3C-acl-adv-3001]
rule 0 permit ip source 3.3.3.3 0
#
定义流分类redirect_class_1,匹配acl 3000
[H3C]
traffic classifier redirect_class_1
[H3C-classifier-redirect_class_1]
if-match acl 3000
#
定义流分类redirect_class_2,匹配acl 3001
[H3C]
traffic classifier redirect_class_1
[H3C-classifier-redirect_class_1]
if-match acl 3001
#
定义流行为redirect_behavior_1,动作为redirect
[H3C]
traffic behavior redirect_behavior_1
[H3C-behavior-redirect_behavior_1]
redirect next-hop 20.20.20.0
#
定义流行为redirect_behavior_2,动作为redirect
[H3C]
traffic behavior redirect_behavior_2
[H3C-behavior-redirect_behavior_2
] redirect next-hop 30.30.30.0
#
定义QoS策略redirect_policy,绑定流行为和流动作
[H3C]
qos policy redirect_policy
[H3C-qospolicy-car_policy]
classifier redirect_class_1 behavior redirect_behavior_1
[H3C-qospolicy-car_policy]
classifier redirect_class_2 behavior redirect_behavior_2
[H3C] interface GigabitEthernet
3/1/1
[H3C-GigabitEthernet3/1/1]
qos apply policy redirect_policy inbound
#
验证配置信息
[H3C-GigabitEthernet3/1/1]
display qos policy interface GigabitEthernet 3/1/1
Interface:
GigabitEthernet3/1/1
Direction: Inbound
Policy:
redirect_policy
Classifier:
redirect_class_1
Operator:
AND
Rule(s) : If-match acl
3000
Behavior:
redirect_behavior_1
Redirect
enable:
Redirect type: next-hop
Redirect destination:
20.20.20.0
Classifier:
redirect_class_2
Operator:
AND
Rule(s) : If-match acl
3001
Behavior:
redirect_behavior_2
Redirect
enable:
Redirect type: next-hop
Redirect destination:
30.30.30.0
& 说明:
l
出方向redirect与filter deny,remark qos-local-id,remark local-precedence,remark forwarding-class,mirror,primap color-map-dp,remark dp冲突
l
入方向redirect与filter deny,remark qos-local-id,remark local-precedence,remark forwarding-class冲突,另外,入方向redirect cpu与mirror-to cpu冲突
l
本文档不严格与具体软、硬件版本对应。