The peer allow-as-loop command sets the number of local AS number repetitions.
The undo peer allow-as-loop command cancels the configuration.
By default, the local AS number cannot be repeated.
Usage Scenario
BGP uses AS numbers to detect routing loops. The AS numbers in the AS_Path of each received route are matched against the local AS number configured using the bgp command and the fake AS number configured using the peer fake-as command. The largest number of times any of the configured AS numbers is repeated is considered as the maximum number. In the Hub and Spoke networking, if EBGP runs between a Hub-PE and a Hub-CE on a Hub site, the route sent from the Hub-PE to the Hub-CE carries the AS number of the Hub-PE. If the Hub-CE sends a routing update to the Hub-PE, the Hub-PE will deny it because the routing update contains the AS number of the Hub-PE.
To ensure proper route transmission in the Hub and Spoke networking, configure all the BGP peers on the path, along which the Hub-CE advertises private network routes to the Spoke-CE, to accept the routes in which the AS number repeats once.Prerequisites
Peer relationships have been established using the peer as-number command.
Configuration Impact
If the peer allow-as-loop command is run for a peer multiple times, the latest configuration overrides the previous one.
<HUAWEI> system-view [~HUAWEI] ip vpn-instance vpna [*HUAWEI-vpn-instance-vpna] ipv4-family [*HUAWEI-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1 [*HUAWEI-vpn-instance-vpna-af-ipv4] quit [*HUAWEI-vpn-instance-vpna] quit [*HUAWEI] bgp 100 [*HUAWEI-bgp] ipv4-family vpn-instance vpna [*HUAWEI-bgp-vpna] peer 1.1.1.1 as-number 100 [*HUAWEI-bgp-vpna] peer 1.1.1.1 allow-as-loop 2 <HUAWEI> system-view [~HUAWEI] ip vpn-instance vpna [*HUAWEI-vpn-instance-vpna] ipv4-family [*HUAWEI-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1 [*HUAWEI-vpn-instance-vpna-af-ipv4] quit [*HUAWEI-vpn-instance-vpna] quit [*HUAWEI] bgp 100 [*HUAWEI-bgp] vpn-instance vpna [*HUAWEI-bgp-instance-vpna] peer 1.1.1.1 as-number 100 [*HUAWEI-bgp-instance-vpna] quit [*HUAWEI-bgp] ipv4-labeled-unicast vpn-instance vpna [*HUAWEI-bgp-labeled-vpna] peer 1.1.1.1 enable [*HUAWEI-bgp-labeled-vpna] peer 1.1.1.1 allow-as-loop 2