< Home

Configuring the AS_Path Attribute

The AS_Path attribute is used to prevent routing loops and control route selection.

Procedure

  • Configure the AS_Path attribute in the IPv6 address family view.
    1. Access the system view.

      system-view

    2. Access the BGP view.

      bgp { as-number-plain | as-number-dot }

    3. Access the BGP IPv6 unicast address family view.

      ipv6-family unicast

    4. Run the following commands to configure the AS_Path attribute as required:

      • Allow the local AS number to be used repeatedly.

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

      • Configure BGP to ignore AS_Path attributes of routes during route selection.

        bestroute as-path-ignore

      • Configure the device to delete private AS numbers (if any) from the AS_Path attribute before sending update packets.

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

        The peer public-as-only command can be used only on EBGP peers.

        After the command without force is run, the device does not delete the private AS numbers from the AS_Path attribute before sending update packets in either of the following scenarios:

        • The AS_Path of a route contains the AS number of the peer. In this case, deleting the private AS numbers may lead to a routing loop.
        • The AS_Path list contains both public network AS numbers and private AS numbers, indicating that the route has passed through the public network. Deleting the private AS numbers may lead to a forwarding error.

        To enable the device to delete the private AS numbers from the AS_Path attribute before sending update packets even in the preceding scenarios, specify force in the command.

  • Configure a fake AS number.
    1. Access the system view.

      system-view

    2. Access the BGP view.

      bgp { as-number-plain | as-number-dot }

    3. Set the fake AS number.

      peer { ipv6-address | group-name } fake-as { as-number-plain | as-number-dot }

      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.

      This command is applicable only to EBGP peers.

  • Enable AS number replacement.
    1. Access the system view.

      system-view

    2. Access the BGP view.

      bgp { as-number-plain | as-number-dot }

    3. Access the BGP IPv6 unicast address family view.

      ipv6-family unicast

    4. Enable AS number replacement.

      peer { ipv6-address | group-name } substitute-as

      After this command is used, if the AS_Path attribute contains the AS number of the peer, the device replaces the AS number of the peer with the local AS number before advertising routes to the peer.

      If the configuration is incorrect, the command may cause routing loops.

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