Configuring BGP

BGP Configuration Examples

Inbound route maps could perform prefix-based matching and set various parameters of the update. Inbound prefix matching is available in addition to autonomous system path and community list matching. The following example shows how the set local-preferenceroute-map configuration command sets the local preference of the inbound prefix 140.10.0.0/16 to 120:

!

router bgp 100 network 131.108.0.0

neighbor 131.108.1.1 remote-as 200

neighbor 131.108.1.1 route-map set-local-pref in

!

route-map set-local-pref permit 10 match ip address 2

set local preference 120

!

route-map set-local-pref permit 20

!

access-list 2 permit 140.10.0.0 0.0.255.255 access-list 2 deny any

The following examples show how to ensure that traffic from one router on a shared LAN will always be passed through a second router, rather than being sent directly to a third router on the same LAN.

Routers A, B, and C connect to the same LAN. Router A peers with router B, and router B peers with router C. Router B sends traffic over the routes of router A to router C, but wants to make sure that all traffic from router C to router A goes through router B, rather than directly from router C to router A over the shared LAN. This configuration can be useful for traffic accounting purposes or to satisfy the peering agreement between router C and router B. You can achieve this configuration by using the set ip next-hoproute-map configuration command as shown in the following two examples.

Example one applies an inbound route map on the BGP session of router C with router B.

Router A Configuration

router bgp 100

neighbor 1.1.1.2 remote-as 200

Router B Configuration

router bgp 200

neighbor 1.1.1.1 remote-as 100 neighbor 1.1.1.3 remote-as 300

Router C Configuration

router bgp 300

neighbor 1.1.1.2 remote-as 200

neighbor 1.1.1.2 route-map set-peer-address in

route-map set-peer-address permit 10 set ip next-hop peer-address

The following example applies an outbound route map on the BGP session of router B with router C:

Router A Configuration

router bgp 100

neighbor 1.1.1.2 remote-as 200

Router B Configuration

router bgp 200

neighbor 1.1.1.1 remote-as 100

Cisco IOS IP Configuration Guide

IPC-335

Page 381
Image 381
Cisco Systems 78-11741-02 manual IPC-335, Router bgp Neighbor 1.1.1.2 remote-as, Router bgp Neighbor 1.1.1.1 remote-as