No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

Configuration Guide - IP Unicast Routing

S7700 and S9700 V200R011C10

This document describes IP Unicast Routing configurations supported by the switch, including the principle and configuration procedures of IP Routing Overview, Static Route, RIP, RIPng, OSPF, OSPFv3, IS-IS(IPv4), IS-IS(IPv6), BGP, Routing Policy ,and PBR, and provides configuration examples.
Rate and give feedback :
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Configuring the AS_Path Attribute

Configuring the AS_Path Attribute

Context

The AS_Path attribute records all of the ASs that a route passes through from the source to the destination in the vector order. You can configure the AS_Path attribute to implement flexible route selection.

  • Generally, BGP compares the AS_Path lists of routes and prefers the route with the shortest AS_Path list. When the AS_Path attribute is not required in route selection, configure BGP not to compare the AS_Path lists of routes during route selection.

  • In most cases, BGP detects routing loops based on the AS number. However, to ensure correct route transmission on a hub-and-spoke network, you need to configure all the BGP peers that VPN routes advertised from a hub CE to a spoke CE pass through to accept the routes with a repeated AS number.

  • Public AS numbers can be used on the Internet, but not private AS numbers because they may cause routing loops. To prevent routing loops, configure the AS_Path attribute to carry only public AS numbers in EBGP Update messages.

  • When the AS_Path attribute is reconstructed or summarized routes are generated, you can set the maximum number of AS numbers in the AS_Path attribute. Then a BGP device checks whether the number of AS numbers in the AS_Path attribute of a route exceeds the maximum value. If so, the BGP device discards the route.

  • A device usually supports only one BGP process. This indicates that a device supports only one AS number. In some cases, for example, when network migration changes an AS number, you can set a fake AS number to ensure successful network migration.

  • BGP checks the first AS number in the AS_Path list that is carried in the Update message sent by an EBGP peer. If the first AS number specifies the AS where the EBGP peer resides, BGP accepts the Update message. Otherwise, BGP rejects the Update message and interrupts the EBGP connection. If you do not want BGP to check the first AS number, disable the option.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run route-policy route-policy-name { deny | permit } node node

    A node is configured for a route-policy, and the view of the route-policy is displayed.

  3. (Optional) Configure matching rules for the route-policy to change only the community attributes of the routes that meet the matching rules.

    By default, all routes meet matching rules. For details, see (Optional) Configuring an if-match Clause.

  4. Run apply as-path { as-number-plain | as-number-dot } &<1-10> { additive | overwrite }

    The AS_Path attribute is set for BGP routes.

  5. Run quit

    Return to the system view.

  6. Run bgp { as-number-plain | as-number-dot }

    The BGP view is displayed.

  7. Enter the corresponding address family view based on network type to configure BGP devices on networks.

    • Run ipv4-family { unicast | multicast }

      The IPv4 address family view is displayed.

    • Run ipv6-family [ unicast ]

      The IPv6 address family view is displayed.

  8. Add the AS_Path attribute to routes.
    • Run peer { ipv4-address | group-name | ipv6-address } route-policy route-policy-name export

      The AS_Path attribute is added to the routes advertised to BGP peers or peer groups.

    • Run peer { ipv4-address | group-name | ipv6-address } route-policy route-policy-name import

      The AS_Path attribute is added to the routes received from BGP peers or peer groups.

    • Run import-route protocol [ process-id ] route-policy route-policy-name

      The AS_Path attribute is added to the routes imported by BGP in import mode.

    • Run network { ipv4-address [ mask | mask-length ] | ipv6-address prefix-length } route-policy route-policy-name

      The AS_Path attribute is added to the routes imported by BGP in network mode.

  9. (Optional) Run any of the following commands to configure the AS_Path attribute as required.

    • Run bestroute as-path-ignore

      BGP is configured not to compare the AS_Path attributes of routes during route selection.

      By default, BGP compares the AS_Path attributes of routes during route selection.

    • Run peer { ipv4-address | group-name | ipv6-address } allow-as-loop [ number ]

      Repeated local AS numbers are allowed in routes.

      By default, repeated local AS numbers are not allowed.

    • Run peer { ipv4-address | group-name | ipv6-address } public-as-only [ force ]

      BGP is configured to carry only public AS numbers in the AS_Path attribute in an EBGP Update message.

      By default, the AS_Path attribute can carry both public and private AS numbers in an EBGP Update message.

    • Return to the BGP view to configure the AS_Path attribute.
      1. Run quit

        Return to the BGP view.

      2. (Optional) Run any of the following commands to configure the AS_Path attribute as required.
        • Run as-path-limit as-path-limit-num

          The maximum number of AS numbers in the AS_Path attribute is set.

          By default, the maximum number of AS numbers in the AS_Path attribute is 255.

        • Run peer { ipv4-address | group-name | ipv6-address } fake-as { as-number-plain | as-number-dot } [ prepend-global-as ]

          The peer fake-as command can be used to hide the actual AS number of a BGP device. EBGP peers in other ASs will use the fake AS number of this BGP device to set up EBGP peer relationships with this device.

          A fake AS number is configured for an EBGP peer group.

          By default, EBGP peers establish a connection using the actual AS number.

          Running the undo check-first-as command increases the probability of routing loops. Therefore, exercise caution when using this command.

        • Run undo check-first-as

          BGP is configured not to check the first AS number in the AS_Path list that is carried in the Update message sent by an EBGP peer.

          By default, BGP checks the first AS number in the AS_Path list that is carried in the Update message sent by an EBGP peer.

          NOTE:

          When BGP is disabled from checking the first AS number, run the refresh bgp command in the user view if you want BGP to check the first AS number of received routes.

Translation
Download
Updated: 2019-04-01

Document ID: EDOC1000178324

Views: 205170

Downloads: 178

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next