Defining a Traffic Behavior and Configuring Actions

This section describes how to configure traffic behaviors.

Context

The device supports various types of traffic behaviors and traffic actions. You can choose one or more types of traffic behaviors and traffic actions as required.

Procedure

  • Configure packet filtering actions.

    Do as follows on the router:

    1. Run system-view

      The system view is displayed.

    2. Run traffic behavior behavior-name

      A traffic behavior is configured and the traffic behavior view is displayed.

    3. Run permit | deny

      Packets are allowed or forbidden to pass.

      If both the if-match any and deny parameters are configured in a complex traffic classification rule, the device discards all packets, including protocol packets, that flow through an interface. Therefore, exercise caution when configuring both the if-match any and deny parameters in a traffic classification rule.

      If the permit or deny action is configured in both the rule command and the traffic behavior view, only packets that are permitted by the rule command are processed according to the configured traffic behavior. If the deny action is configured in either the rule command or the traffic behavior view, all matched packets are discarded.

    4. Run commit

      The configuration is committed.

  • Configure traffic policing actions.

    Do as follows on the router:

    1. Run system-view

      The system view is displayed.

    2. Run traffic behavior behavior-name

      A traffic behavior is configured and the traffic behavior view is displayed.

    3. Run car { cir cir-value [ pir pir-value ] } [ cbs cbs-value [ pbs pbs-value ] ] [ adjust adjust-value ] [ green { discard | pass [ remark dscp dscp-value | service-class class color color ] } | yellow { discard | pass [ remark dscp dscp-value | service-class class color color ] } | red { discard | pass [ remark dscp dscp-value | service-class class color color ] } ] * [ summary ] [ color-aware ] [ limit-type pps ]

      A traffic policing action is configured.

      After you configure a traffic policing action for a traffic policy, the traffic policy can be applied to both incoming and outgoing traffic on an interface.

      The original qos car command that is configured on an interface will be affected after a traffic policy configured with traffic policing action is applied to the interface.

      This command is cyclic in nature. That is, if this command is configured for multiple times, only the last configuration takes effect.

      If the CoS of a packet is re-marked as EF, BE, CS6, or CS7, the packet can be re-marked only in green.

    4. Run user-queue cir cir-value [ [ pir pir-value ] | [ flow-queue flow-queue-name ] | [ user-group-queue group-name ] | [ service-template service-template-name ] ]*

      The class-based HQOS parameters for the specified traffic behavior is configured.

      The outgoing traffic supports class-based HQoS scheduling only when the traffic policy works in unshared mode and is applied to an ETM subcard.

      The user-queue and car commands cannot be both configured in the same traffic behavior.

    5. Run commit

      The configuration is committed.

  • Set the packet precedence.

    Do as follows on the router:

    1. Run system-view

      The system view is displayed.

    2. Run traffic behavior behavior-name

      A traffic behavior is configured and the traffic behavior view is displayed.

    3. Configure the router as follows:

      • To re-mark the precedence of IP packets, run the remark ip-precedence ip-precedence command.

      • To re-mark the DSCP value of IP packets, run the remark [ ipv6 ] dscp dscp-value command.

      • To re-mark the precedence of VLAN packets, run the remark 8021p 8021p-value command.

      • To re-mark the Type of Service (ToS) value of an IP packet, run the remark tos remark tos command.

      • To re-mark the DF (Do not Fragment) value of IPv4 packets, run the remark ip-df command.
      • To re-mark the TTL value of IPv4 packets, run the remark ttl ttl-value command.

      To re-mark the DSCP value of IPv6 packets, run the remark ipv6 dscp dscp-value command.

      The remark ip-df command takes effect with only incoming traffic on the router.

    4. Run commit

      The configuration is committed.

  • Configure forced traffic classification.
    1. Run system-view

      The system view is displayed.

    2. Run traffic behavior behavior-name

      A traffic behavior is configured, and the traffic behavior view is displayed.

    3. Run service-class service-class color color

      Packets with a certain CoS are colored.

    4. (Optional) Run service-class service-class color color track { master | slave } bfd-session session-name bfd-session-name

      The function of marking matching packets' CoS and color based on the status of the specified BFD session is configured.

    5. Run commit

      The configuration is committed.

  • Set packet forwarding actions.

    • Redirecting of packets to the public network LSP can be configured only on the ingress node of the MPLS network, and cannot be configured on other nodes such as transit or egress.
    • Redirecting of packets to the public network LSP can be configured for only single-tagged MPLS packets.

    Do as follows on the router:

    1. Run system-view

      The system view is displayed.

    2. Run traffic behavior behavior-name

      A traffic behavior is configured and the traffic behavior view is displayed.

    3. Configure the router as follows:

      • To directly forward packets without redirecting them, run the permit command in the traffic behavior view.

      • To directly drop packets without redirecting them, run the deny command in the traffic behavior view.

        The action deny and other traffic actions are mutually exclusive. Traffic that is configured with the deny action cannot be further processed unless the traffic is configured with the permit action.

      • To configure the IP address and outbound interface, VPN instance, and NQA instance on a single next hop for redirecting IPv4 packets, run the following command.
        • redirect ip-nexthop ip-address interface interface-type interface-number [ route-forward ]
        • redirect ip-nexthop ip-address nqa nqa-test-administer-name name-of-nqa-test-instance [ routing-filter { default-routing | blackhole-routing } * ]
        • redirect ip-nexthop ip-address vpn vpn-instance-name [ nqa nqa-test-administer-name name-of-nqa-test-instance ] [ routing-filter { default-routing | blackhole-routing } * ]
      • To configure the IP addresses and outbound interfaces, VPN instances, and NQA instances on multiple next hops for redirecting IPv4 packets, run the following command.
        • redirect ipv4-multinhp { nhp ip-address interface interface-type interface-number } &<2-42> [ loadbalance ] [ unequal-cost ]
        • redirect ipv4-multinhp { nhp ip-address nqa nqa-test-administer-name name-of-nqa-test-instance } &<2-42> [ routing-filter { default-routing | blackhole-routing } * ]
        • redirect ipv4-multinhp { nhp ip-address vpn vpn-instance-name [ nqa nqa-test-administer-name name-of-nqa-test-instance ] } &<2-42> [ routing-filter { default-routing | blackhole-routing } * ] [ pri-type common ] [ non-revertive ]
      • To configure the IP address and outbound interface, VPN instance, and NQA instance on a single next hop for redirecting IPv6 packets, run the following command.
        • redirect ipv6-nexthop ip-address interface interface-type interface-number [ route-forward ]
        • redirect ipv6-nexthop ip-address nqa nqa-test-administer-name name-of-nqa-test-instance [ routing-filter { default-routing | blackhole-routing } * ]
        • redirect ipv6-nexthop ip-address vpn vpn-instance-name [ nqa nqa-test-administer-name name-of-nqa-test-instance ] [ routing-filter { default-routing | blackhole-routing } * ]
      • To configure the IP addresses and outbound interfaces, VPN instances, and NQA instances on multiple next hops for redirecting IPv6 packets, run the following command.
        • redirect ipv6-multinhp { nhp ip-address interface interface-type interface-number } &<2-16> [ loadbalance [ sip-hash ] ] [ route-forward ] [ pri-type common ][ unequal-cost ]
        • redirect ipv6-multinhp { nhp ip-address nqa nqa-test-administer-name name-of-nqa-test-instance } &<2-16> [ routing-filter { default-routing | blackhole-routing } * ]
        • redirect ipv6-multinhp { nhp ip-address vpn vpn-instance-name [ nqa nqa-test-administer-name name-of-nqa-test-instance ] } &<2-16> [ routing-filter { default-routing | blackhole-routing } * ]
      • In a scenario in which a forward policy redirects packets to a single next hop whose IP address matches a default route or a black-hole route, if you want packets to be forwarded based on destination IP addresses, run the following command.
      • In a scenario in which a forward policy redirects packets to multiple next hops whose IP addresses match default or black-hole routes, if you want packets to be forwarded based on destination IP addresses, run the following command.
        • redirect ipv4-multinhp { nhp ip-address } &<2-42> [ routing-filter { default-routing | blackhole-routing } * ]
        • redirect ipv6-multinhp { nhp ip-address } &<2-16> [ routing-filter { default-routing | blackhole-routing } * ]
      • To redirect IPv4 or IPv6 packets to be forwarded using private network routes to public network routes' outbound interfaces, run the redirect { ip | ipv6 } public-network command.
      • To redirect IP packets to the public network LSP, run the redirect lsp public dest-ipv4-address [ nexthop-address | interface interface-type interface-number | secondary ] command.

      • To redirect packets to a specified VPN group, run the redirect vpn-group vpn-group-name command.

      • To redirect packets to a specified VSI, run the redirect vsi vsi-name.
      • To redirect ipv4 packets to a specified outbound interface, run the redirect to interface { interface-name | interface-type interface-number } [ route-forward ] command.
      • To redirect ipv6 packets to a specified outbound interface, run the redirect ipv6 to interface { interface-name | interface-type interface-number } [ route-forward ] command.

      When the redirection policy in the traffic behavior is a Discard policy, the IP address and outbound interface of the next hop must be specified. When the redirection policy in the traffic behavior is a Forward policy, the IP address of the next hop must be specified.

      In IPv6 application, the IP address of the next hop specified for a Discard policy must be an IPv6 link-local address or an IPv6 unicast address; the IP address of the next hop specified for a Forward policy can be only an IPv6 unicast address.

    4. Run commit

      The configuration is committed.

  • Configure the load balancing mode.

    Do as follows on the router:

    1. Run system-view

      The system view is displayed.

    2. Run traffic behavior behavior-name

      A traffic behavior is configured and the traffic behavior view is displayed.

    3. Run load-balance { flow [ l2 | l3 ] | packet }

      The load balancing mode is set.

    4. Run commit

      The configuration is committed.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >