Usage Scenario
Generally, 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 routing loop count. However, in Hub and Spoke networking, if EBGP runs between a Hub-PE and a Hub-CE, the routes that the Hub-PE sends to the Hub-CE carry the AS number of the Hub-PE; if the Hub-CE sends an Update message to the Hub-PE, the Hub-PE discards the message because the message includes 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 VPN routes to the Spoke-CE, to accept the routes that contain the local AS number as long as the number of repetitions in each route is within the default limit (1).
Prerequisites
Peer relationships have been established using the peer as-number command.
Configuration Impact
If the command is run for a peer or peer group multiple times, the latest configuration overrides the previous one.
Precautions
The peer allow-as-loop command enables BGP to check the count of the local AS number in the routes received from EBGP peers or confederation EBGP peers. The command does not apply to IBGP peers or sub-confederation BGP peers. If the command is not run, the implementation is equivalent to the peer allow-as-loop 0 configuration.