The AS_Path attribute records all the ASs that a route passes through from the source to the destination in the vector order. To prevent inter-AS routing loops, a BGP device does not receive the routes of which the AS_Path list contains the local AS number.

When a BGP speaker advertises an imported route:

When a BGP speaker advertises a route learned in the Update message sent by another BGP speaker:

You can configure the AS_Path attribute to implement flexible route selection.

Apply a Routing Policy to Routes Advertised

The set protocols bgp neighbor route-map command applies a route map to incoming or outgoing routes. It can be used to configure the route map for modifying the AS_Path attribute of the route.

admin@XorPlus# set protocols bgp neighbor ipv4-unicast in route-map map1
admin@XorPlus# commit

Configure an AS Path List to Advertise or Receive Routes from Peers

The set protocols bgp neighbor filter-list command configures an AS Path list to advertise or receive routes from peers.

admin@XorPlus# set protocols bgp neighbor ipv4-unicast in filter-list List1
admin@XorPlus# commit

Configure BGP to Treat two BGP Routes as Equal Cost ven if AS-paths Differ

he set protocols bgp bestpath as-path multipath-relax command configures Border Gateway Protocol (BGP) to treat two BGP routes as equal cost even if their AS-paths differ, as long as their AS-path lengths and other relevant attributes are the same. This allows routes with different AS-paths to be programmed into the forwarding table as equal cost multipath routes. Any changes in BGP configuration are applied by restarting the current BGP sessions on the VRFs.

admin@XorPlus# set protocols bgp bestpath as-path multipath-relax
admin@XorPlus# commit