BGP enabled devices use routing updates to exchange network routing information with each other. This information includes route details, such as the network number, path specific attributes, and the list of ASNs (Autonomous System Numbers) that a route traverses to reach a destination. This list is contained in the AS path.
An AS path ACL (access control list) filters AS paths (routes) included in routing updates. Each AS path access list consists of deny and/or permit rules that define regular expressions (match criteria). When configured and applied on inbound and outbound routing updates, the BGP AS path attributes are matched against the regular expressions specified in the AS path ACL. In case of a match, the route is filtered and an action (deny or permit) is applied. Once a match is made subsequent rules in the AS path access list are not processed.
AS path access lists also help prevent looping within an AS. Routing loops are prevented by rejecting routing updates containing local ASNs. Since local ASNs indicate that the route has already traveled through that autonomous system, by rejecting them looping is avoided.
<DEVICE>(config)#bgp as-path <AS-PATH-LIST-NAME>
<DEVICE>(config-bgp-as-path-list-<AS-PATH-LIST-NAME>)#? BGP AS Path List Mode commands: deny Specify packets to reject no Negate a command or set its defaults permit Specify packets to forward clrscr Clears the display screen commit Commit all changes made in this session do Run commands from Exec mode end End current mode and change to EXEC mode exit End current mode and down to previous mode help Description of the interactive help system revert Revert changes service Service Commands show Show running system information write Write running configuration to memory or terminal <DEVICE>(config-bgp-as-path-list-<AS-PATH-LIST-NAME>)#
Command | Description |
---|---|
deny (bgp-as-path-list) | Creates and configures a deny as-path-list rule |
permit (bgp-as-path-list) | Creates and configures a permit as-path-list rule |
no (bgp-as-path-list) | Removes a deny or permit rule from this AS path ACL |