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

CloudEngine 8800, 7800, 6800, and 5800 V200R005C10

This document describes the configurations of IP Unicast Routing, including IP Routing, Static Route, RIP, RIPng, OSPF, OSPFv3, IPv4 IS-IS, IPv6 IS-IS, BGP, Routing Policy, and PBR.
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 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.

  • By default, BGP compares the AS_Path lists of routes and prefers the route. 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.

  • By default, BGP detects routing loops based on 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 private AS numbers cannot 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 BGP from checking the first AS number. BGP can also check whether the first AS number in the AS_Path attribute contained in the update messages received from the specified EBGP peer or peer group is the number of the AS where the EBGP peer or peer group resides. If the function is not configured for a specified EBGP peer, the device checks whether the function is configured for the related peer group; if the function is not configured for the peer group, the device checks whether the function is configured in the BGP view.

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 matching rules.

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

  4. Run apply as-path { { as-number-plain | as-number-dot } &<1-10> { additive | overwrite | delete } | none 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

      The BGP-IPv4 unicast address family view is displayed.

    • Run ipv4-family multicast

      The BGP-IPv4 multicast address family view is displayed.

    • Run ipv4-family vpnv4 [ unicast ]

      The BGP-VPNv4 address family view is displayed.

    • Run ipv4-family vpn-instance vpn-instance-name

      The BGP-VPN instance IPv4 address family view is displayed.

    • Run ipv6-family [ unicast ]

      The BGP-IPv6 unicast address family view is displayed.

    • Run ipv6-family vpnv6 [ unicast ]

      The BGP-VPNv6 address family view is displayed.

    • Run ipv6-family vpn-instance vpn-instance-name

      The BGP-VPN instance IPv6 address family view is displayed.

  8. Add the AS_Path attribute to routes.

    NOTE:

    The import-route and network commands cannot be executed in the BGP-VPNv4 address family view or BGP-VPNv6 address family view.

    • 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 ] [ med med | 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 { group-name | ipv4-address | ipv6-address } public-as-only [ force [ replace ] [ include-peer-as ] | limited [ replace ] [ include-peer-as ] ]

      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.

      NOTE:

      If the 4-byte private AS number function is enabled using the private-4-byte-as enable command, private AS numbers range from 64512 to 65534 and from 4200000000 to 4294967294 (64086.59904 to 65535.65534 in the format of x.y).

    • 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 } local-as { as-number-plain | as-number-dot } [ dual-as ] [ prepend-global-as ] [ prepend-local-as ]

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

          The peer local-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.

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

        • 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:
          • Running the undo check-first-as command increases the probability of routing loops. Therefore, exercise caution when using this command.

          • After the configuration is complete, run the refresh bgp command in the user view if you want to check the received routes again.

        • Enable the device to check or disable the device from checking the first AS number in the AS_Path attribute contained in the update messages received from a specified EBGP peer or peer group.

          • Run peer { group-name | ipv4-address | ipv6-address } check-first-as enable

          • Run peer { group-name | ipv4-address | ipv6-address } check-first-as disable

          By default, a device checks the first AS number in the AS_Path attribute contained in the update messages received from all EBGP peers or peer groups.

          NOTE:

          After the configuration is complete, run the refresh bgp command in the user view if you want to check the received routes again.

  10. Run commit

    The configuration is committed.

Translation
Download
Updated: 2019-04-20

Document ID: EDOC1100074760

Views: 47141

Downloads: 58

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