Sunday, 14 April 2013

BGP PREFIX-LIST


I have been using prefix-list right from where I started bgp. Now lets talk abt it
Default prefix-list seq no is 5 and it also follows the implicit deny all
permit 0.0.0.0/1 le 8
permit 128.0.0.0/2 le 16
permit 192.0.0.0/3 le 24

Default config include bgp  nei relationship and isp2 is advertising its network to all routers in the domain
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


Task 1) ISP1 should filter out prefixes 100.x.x.x.Use a sequence no of 10. Use prefix-list
Lets prove that ISP1 is getting the routes
ISP1# sh ip bgp
   Network          Next Hop            Metric LocPrf Weight Path
*> 100.100.100.0/24 50.50.50.2                             0 100 222 i
*> 100.100.101.0/24 50.50.50.2                             0 100 222 i
*> 100.100.102.0/24 50.50.50.2                             0 100 222 i
*> 100.100.103.0/24 50.50.50.2                             0 100 222 i

ISP(conf)# ip prefix-list A seq 10 deny 100.100.0.0/16 ge 24 le 24
                     ip prefix-list seq 20 permit 0.0.0.0/0 le 32
                     router bgp 111
                     nei  50.50.50.2 prefix-list A in
                     do clear ip bgp 50.50.50.2 in
                     do clear ip bgp 50.50.50.2 out

To view the changes made,
ISP1#sh ip bgp                                                                   [we see no routes]
ISP1#sh ip bgp nei  50.50.50.2 routes                       [w see no routes]
ISP1#sh ip bgp nei 50.50.50.2 received-route      [to display routes rcved from nei but not accepted]
   Network          Next Hop            Metric LocPrf Weight       Path
*  100.100.100.0/24 50.50.50.2                             0     100 222 i
*  100.100.101.0/24 50.50.50.2                             0     100 222 i
*  100.100.102.0/24 50.50.50.2                             0     100 222 i
*  100.100.103.0/24 50.50.50.2                             0     100 222 i




No comments:

Post a Comment