Configuring BGP

BGP Configuration Examples

set local-preference 25 set metric 127

set weight 30000

set next-hop 192.92.68.24 set origin igp

!

access-list 1 permit 131.108.0.0 0.0.255.255 access-list 1 permit 160.89.0.0 0.0.255.255 access-list 1 permit 198.112.0.0 0.0.127.255

It is proper behavior to not accept any autonomous system path not matching the match clause of the route map. This behavior means that you will not set the metric and the Cisco IOS software will not accept the route. However, you can configure the software to accept autonomous system paths not matched in the match clause of the route-maprouter configuration command by using multiple maps of the same name, some without accompanying set commands.

route-map fnord permit 10 match as-path 1

set local-preference 5

!

route-map fnord permit 20 match as-path 2

The following example shows how you can use route maps in a reverse operation to set the route tag (as defined by the BGP/OSPF interaction document, RFC 1403) when exporting routes from BGP into the main IP routing table:

router bgp 100 table-map set_ospf_tag

!

route-map set_ospf_tag match as-path 1

set automatic-tag

!

ip as-path access-list 1 permit .*

The following example shows how the route map named set-as-path is applied to outbound updates to the neighbor 200.69.232.70. The route map will prepend the autonomous system path “100 100” to routes that pass access list 1. The second part of the route map is to permit the advertisement of other routes.

router bgp 100 network 171.60.0.0 network 172.60.0.0

neighbor 200.69.232.70 remote-as 200

neighbor 200.69.232.70 route-map set-as-path out

!

route-map set-as-path 10 permit match address 1

set as-path prepend 100 100

!

route-map set-as-path 20 permit match address 2

!

access-list 1 permit 171.60.0.0 0.0.255.255 access-list 1 permit 172.60.0.0 0.0.255.255

!

access-list 2 permit 0.0.0.0 255.255.255.255

Cisco IOS IP Configuration Guide

IPC-334

Page 380
Image 380
Cisco Systems 78-11741-02 manual IPC-334, Set local-preference 25 set metric Set weight, Access-list 2 permit 0.0.0.0