好消息,超酷的在线虚拟网络实验室上线了!点击开始实验

为获得更好的浏览效果,建议您使用 Firefox 或者 Chrome 浏览器



 

3.2.5 Redirect配置举例

 

组网需求

对从GE3/1/2接口进来的源IP2.2.2.2IP报文,从接口GE3/1/2出去,源IP3.3.3.3IP报文,从接口GE3/1/3出去。

图1  Redirect配置组网图

 

配置思路

l              配置acl 3000,匹配源ip2.2.2.2的数据流

l              配置acl 3001,匹配源IP3.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       出方向redirectfilter denyremark qos-local-idremark local-precedenceremark forwarding-classmirrorprimap color-map-dpremark dp冲突

l       入方向redirectfilter denyremark qos-local-idremark local-precedenceremark forwarding-class冲突,另外,入方向redirect cpumirror-to cpu冲突

l       本文档不严格与具体软、硬件版本对应。

 

X Close
X Close