[Contents]
[Prev]
[Next]
[Index]
[Report an Error]
Configuration Example 1
In Figure 4, a route map
is used to determine the weight for routes learned by router Chicago.
Figure 4: Route Map Filtering

Access list 1 permits any route whose AS-path attribute
includes 32 or 837. This condition permits routes that originate in
(or pass through from elsewhere) AS 32 or AS 837. When these routes
are advertised through AS 451 and AS 17 to router Chicago, instance
1 of route map 1 matches such routes and sets their weight to 25,
overriding the neighbor weight set for updates received from 10.2.2.4.
Access list 2 permits any route whose AS-path attribute
indicates that it originates in AS 74. When these routes are advertised
through AS 837 and AS 32 to router Chicago, instance 1 of route map
2 matches such routes and sets their weight to 175, overriding the
neighbor weight set for updates received from 10.5.5.2.
The following example configures router Chicago:
- host1(config)#router bgp 293
- host1(config-router)#network 192.168.5.0 mask
255.255.255.0
- host1(config-router)#neighbor 10.2.2.4 remote-as
17
- host1(config-router)#neighbor 10.2.2.4 weight
150
- host1(config-router)#neighbor 10.2.2.4 route-map
1 in
- host1(config-router)#exit
- host1(config-router)#neighbor 10.5.5.2 remote-as
32
- host1(config-router)#neighbor 10.5.5.2 weight
50
- host1(config-router)#neighbor 10.5.5.2 route-map
2 in
- host1(config)#route-map 1 permit 1
- host1(config-route-map)#match as-path 1
- host1(config-route-map)#set weight 25
- host1(config-route-map)#exit
- host1(config)#ip as-path access-list 1 permit [ 32 837 ]
- host1(config)#route-map 2 permit 1
- host1(config-route-map)#match as-path 2
- host1(config-route-map)#set weight 175
- host1(config-route-map)#exit
- host1(config)#ip as-path access-list 2 permit [ 74 ]
The result of this configuration is that router
Chicago prefers routes learned through router Boston (weight 150)
over routes learned through router NY (weight 50), except that:
- Router Chicago prefers routes learned via router NY that
passed through AS 837 or AS 32 (weight 50) over the same routes learned
via router Boston (weight 25 according to route map 1).
- Router Chicago prefers routes originating in AS 74 learned
via router NY that passed through AS 837 and AS 32 (weight 175 according
to route map 2) over the same routes learned via router Boston (weight
150).
access-list
- Use to define an IP access list to permit or deny routes
based on the prefix.
- Each access list is a set of permit or deny conditions
for routes based on matching a route's prefix.
- A zero in the wildcard mask means that the corresponding
bit in the address must be exactly matched by the route. A one in
the wildcard mask means that the corresponding bit in the address
does not have to be matched by the route.
- Use the neighbor distribute-list command to apply the access list to routes received from or forwarded
to a neighbor.
- Use the log keyword to log
an Info event in the ipAccessList log whenever an access list rule
is matched.
- Example
- host1(config)#access-list bronze permit ip
host any 228.0.0.0 0.0.0.255
- Use the no version to delete
an IP access list (no other options specified), the specified entry
in the access list, or the log for the specified access list or entry
(by specifying the log keyword).
- See access-list.
default-information
originate
- Use to enable RIP, OSPF, or BGP
to advertise a default route (0.0.0.0/0) that exists in the IP routing
table.
- If you specify the always option
for OSPF, OSPF generates a default route, if it does not exist in
the IP routing table and advertises it.
- Use to generate a default route to an IS-IS domain.
- Example
- host1(config-router)#default-information originate
- Use the no version to disable
advertisement of the default route.
- See default-information originate.
ip
as-path access-list
- Use to define an AS-path access list to permit or deny
routes based on the AS path.
- Each access list is a set of permit or deny conditions
for routes based on matching a route's AS path to a regular expression.
If the regular expression matches the representation of the AS path
of the route as an ASCII string, the permit or deny condition applies.
The AS path does not contain the local AS number.
- The AS path allows substring matching. For example, the
regular expression 20 matches AS path = 20 and AS path = 100 200 300, because 20 is a substring of each path. To disable substring matching
and constrain matching to only the specified attribute string, place
the underscore (_) metacharacter on both
sides of the string; for example, _20_.
- Use the neighbor filter-list command to apply the AS-path access list. You can apply access-list
filters to inbound and outbound BGP routes. You can assign weights
to routes matching the AS-path access list.
- Example
- host1(config)#ip as-path access-list 1 permit ^\(
- Use the no version to remove
the AS-path access list; all entries that belong to this list are
removed.
- See ip as-path access-list.
ipv6
access-list
- Use to define an IPv6 access list to permit or deny routes
based on the prefix.
- Each access list is a set of permit or deny conditions
for routes based on matching a route's prefix.
- Use the neighbor distribute-list command to apply the access list to routes received from or forwarded
to a neighbor.
- Use the log keyword to log
an Info event in the ipAccessList log whenever an access list rule
is matched.
- Example
- host1(config)#ipv6 access-list bronze deny
1::1/16 any
- Use the no version to delete
an IPv6 access list (no other options specified), the specified entry
in the access list, or the log for the specified access list or entry
(by specifying the log keyword).
- See ipv6 access-list.
neighbor
distribute-list
- Use to filter routes to selected prefixes as specified
in an access list. Distribute lists are applied only to external peers.
- Use the in keyword to apply
the list to inbound routes (inbound policy). Use the out keyword to apply the list to outbound routes (outbound
policy).
- Besides using distribute lists to filter BGP advertisements,
you can do the following:
- Use AS-path filters with the ip as-path access-list and the neighbor filter-list commands
- Use route map filters with the route-map and the neighbor route-map commands
- Example
- host1:vr1(config-router)#neighbor group1 distribute-list
list1 in
- Use the no version to disassociate
the access list from a neighbor.
- See neighbor distribute-list.
neighbor
filter-list
- Use to assign an AS-path access list to matching inbound
or outbound routes.
- Use the in keyword to apply
the list to inbound routes (inbound policy). Use the out keyword to apply the list to outbound routes (outbound
policy).
- You can specify an optional weight value with the weight keyword to assign a relative importance to incoming
routes that match the AS-path access list.
- Access list values can be in the range 0–65535.
- Example
- host1:vr1(config-router)#neighbor group2 filter-list
list2 out
- Use the no version to disassociate
the access list from a neighbor.
- See neighbor filter-list.
neighbor
prefix-list
- Use to assign an inbound or outbound prefix list.
- If you specify a BGP peer group by using the peer-group-name argument, all the members of the peer
group inherit the characteristic configured with this command unless
it is overridden for a specific peer.
- Use the in keyword to assign
the prefix list to incoming routes (inbound policy)
- Use the out keyword to assign
the prefix list to outgoing routes (outbound policy); you cannot configure
a member of a peer group to override the inherited peer group characteristic
for outbound policy
- Example
- host1(config-router)#neighbor 192.168.1.158
prefix-list seoul19 in
- Use the no version to remove
the prefix list.
- See neighbor prefix-list.
neighbor
prefix-tree
- Use to assign an inbound or outbound prefix tree.
- If you specify a BGP peer group by using the peer-group-name argument, all the members of the peer
group inherit the characteristic configured with this command unless
it is overridden for a specific peer.
- Use the in keyword to assign
the prefix tree to incoming routes (inbound policy)
- Use the out keyword to assign
the prefix tree to outgoing routes (outbound policy); you cannot configure
a member of a peer group to override the inherited peer group characteristic
for outbound policy
- Example
- host1(config-router)#neighbor 192.168.1.158
prefix-tree newyork out
- Use the no version to remove
the prefix tree.
- See neighbor prefix-tree.
redistribute
- Use to redistribute routes from one routing domain to
another routing domain.
- Example
- host1(config)#router bgp 100
- host1(config-router)#neighbor 192.56.10.2
remote-as 200
- host1(config-router)#redistribute static
- host1(config-router)#exit
- host1(config)#ip route 155.30.0.0 0.0.255.255
- Use the no version to end redistribution
of information.
- See redistribute.
[Contents]
[Prev]
[Next]
[Index]
[Report an Error]