System information

Configuring BGP
12-63
MOT(config-bgp)#ip as-path access-list <access-list-number> {permit | deny}
<path-expression>
where:
access-list-number is the access list number.
path-expression is a valid path regular expression.
Example
The commands in the following example configure a router with two AS path access
lists. Routes that pass AS path access list 1 are sent to one destination. Routes that
pass AS path access list 2 are accepted from another destination. The commands,
executed in Global Configuration mode, specify permit and deny conditions for AS
path access lists 1 and 2.
MOT(config-bgp)#ip as-path access-list 1 permit _200
MOT(config-bgp)#ip as-path access-list 1 permit ^100
MOT(config-bgp)#ip as-path access-list 2 deny _690
MOT(config-bgp)#ip as-path access-list 2 permit.*
The next command, executed in Global Configuration mode, enables BGP and
specifies an AS. The next commands, executed in Router BGP Configuration mode,
define two neighbor peers, and assign the AS path list to one of the neighbor BGP
peers. This indicates that outbound routes have the conditions defined in AS path
access list 1 applied to it.
MOT(config)#router bgp 100
MOT(config-bgp)#neighbor 156.30.10.22 remote-as 200
MOT(config-bgp)#neighbor 160.25.15.10 remote-as 300
MOT(config-bgp)#neighbor 156.30.10.22 filter-list 1 out
Creating a Community List
Peers exchange the BGP community attributes when they exchange reachability
information with each other. A community is a group of destinations that share a
common policy. Based on community, you can control the routing information a BGP
speaker accepts, prefers, or distributes to other neighbors.
You can use the following predefined well-known community attributes with the
set-community command in a route map: