Wednesday, 3 April 2013

ROUTE-MAPS


We happen to use route-maps a lot in bgp. Hence we would talk briefly on it laying emphasis on policy-list and continue feature
by default metric is always empty for routes advertised into bgp. default route-map match action is to match all.. likewise policy-list if u want to match any use policy list [match policy-list A B]
note that if we have
match ip add ade
match ip add bisi
the default match action wild b to match any of them

if we av
match ip add ade
match as-path 1000
the default wld b to match all of them

Default config (bgp relationship has already been configured and networks 100.100.100.0, 100.100.101.0, 100.100.102.0 and 100.100.103.0 respectively.)
R1.....................
int s0/1
ip add 20.20.20.1 255.255.255.0
no shut
int  s0/0
ip add 10.10.10.1 255.255.255.0
no shut
int lo 1
ip add 150.150.150.1 255.255.255.0
no shut
exit
router eigrp 1
network 20.20.20.0 0.0.0.255
network 10.10.10.0 0.0.0.255
no auto-summary
exit
router bgp 100
nei 10.10.10.2 remote-as 222
nei 20.20.20.2 remote-as 100
nei 20.20.20.2 next-hop-self
nei 30.30.30.1 remote-as 100
nei 30.30.30.1 next-hop-self
bgp router-id 150.150.150.1
no synchronization


R2..................
int s0/0
ip add 30.30.30.2 255.255.255.0
no shut
int  s0/1
ip add 20.20.20.2 255.255.255.0
no shut
int s0/2
ip add 50.50.50.2 255.255.255.0
no shut
int lo 1
ip add 77.77.77.1 255.255.255.0
no shut
exit
router eigrp 1
network 20.20.20.0 0.0.0.255
network 30.30.30.0 0.0.0.255
network 50.50.50.0 0.0.0.255
no auto-summary
exit
router bgp 100
nei 30.30.30.1 remote-as 100
nei 30.30.30.1 next-hop-self
nei 20.20.20.1 remote-as 100
nei 20.20.20.1 next-hop-self
nei 50.50.50.1 remote-as 111
bgp router-id 77.77.77.1
no synchronization



R3..........................
int s0/0
ip add 40.40.40.1 255.255.255.0
no shut
int s0/1
ip add 30.30.30.1 255.255.255.0
no shut
int lo 1
ip add 99.99.99.1 255.255.255.0
no shut
exit
router eigrp 1
network 30.30.30.0 0.0.0.255
network 40.40.40.0 0.0.0.255
no auto-summary
router bgp 100
nei 40.40.40.2 remote-as 222
nei 30.30.30.2 remote-as 100
nei 30.30.30.2 next-hop-self
nei 20.20.20.1 remote-as 100
nei 20.20.20.1 next-hop-self
bgp router-id 99.99.99.1
no synchronization



ISP1..................................
int s0/0
ip add 50.50.50.1 255.255.255.0
no shut
int lo 1
ip add 200.200.200.1 255.255.255.0
no shut
exit
router bgp 111
nei 50.50.50.2 remote-as 100
bgp router-id 200.200.200.1
no synchronization



ISP2..................
int s0/1
ip add 40.40.40.2 255.255.255.0
no shut
int  s0/0
ip add 10.10.10.2 255.255.255.0
no shut
int lo 1
ip add 100.100.100.1 255.255.255.0
no shut
int lo 2
ip add 100.100.101.1 255.255.255.0
no shut
int lo 3
ip add 100.100.102.1 255.255.255.0
no shut
int lo 4
ip add 100.100.103.1 255.255.255.0
no shut
exit
router bgp 222
nei 10.10.10.1 remote-as 100
nei 40.40.40.1 remote-as 100
bgp router-id 100.100.100.1
no synchronization
network 100.100.100.0 mask 255.255.255.0
network 100.100.101.0 mask 255.255.255.0
network 100.100.102.0 mask 255.255.255.0
network 100.100.103.0 mask 255.255.255.0

1) ISP1 should assign a metric of 100 for prefixes 100.100.100.0. It should also assign metric of 200 for prefixes 100.100.101.0 and 100.100.102.0..Use a single route-map for this.
(Use policy-list to create d match statements)
ISP(conf)# ip prefix-list A seq 5 permit 100.100.100.0/24
ip prefix-list B seq 5 permit 100.100.101.0/24
ip prefix-list B seq 10 permit 100.100.102.0/24
ip policy-list A permit
match ip add prefix-list A
exit
ip policy-list B permit
match ip add prefix-list B
exit
route-map A permit 10
match policy-list A
set metric 100
exit
route-map A permit 20
match policy-list B
set metric 200
exit
route-map A permit 30                  [to permit all oda routes that are not affected by the prefix-list]
exit

To view changes made,
ISP1#sh ip bgp
   Network          Next Hop            Metric    LocPrf Weight     Path
*> 100.100.100.0/24 50.50.50.2       100                      0            100 222 i
*> 100.100.101.0/24 50.50.50.2       200                      0            100 222 i
*> 100.100.102.0/24 50.50.50.2        200                      0           100 222 i
*> 100.100.103.0/24 50.50.50.2                                 0               100 222 i

No comments:

Post a Comment