We help IT Professionals succeed at work.

Purpose of BGP route-map statements?

when I run sh ip bgp summary I have two peers 1.2.3.4 and 5.6.7.8

If the updates from the network statements coming from this router match the access-list 130 what happens?

If they don't match 130 do they then get checked against 131?

Why does the AS abcde get prepended 5 times?

What is the purpose of the route-map set-prepend?

Any other information would be helpful as I am trying to learn BGP enough to get by at work and pass the BSCI.

router bgp abcde
 no synchronization
 bgp log-neighbor-changes
 network x.x.164.0 mask 255.255.255.0
 network x.x.192.0 mask 255.255.224.0
 network x.x.192.0 mask 255.255.255.0
 network x.x.201.0 mask 255.255.255.0
 network x.x.202.0 mask 255.255.255.0
 network x.x.205.0 mask 255.255.255.0
 network x.x.206.0 mask 255.255.255.0
 network x.x.207.0 mask 255.255.255.0
 network x.x.x.0 mask 255.255.255.0
 neighbor ibgp-mesh peer-group
 neighbor ibgp-mesh remote-as abcde
 neighbor ibgp-mesh update-source Loopback0
 neighbor ibgp-mesh version 4
 neighbor ibgp-mesh next-hop-self
 neighbor 5.6.7.8 peer-group ibgp-mesh
 neighbor 1.2.3.4 remote-as fghi
 neighbor 1.2.3.4 password 7 mypassword
 neighbor 1.2.3.4 send-community both
 neighbor 1.2.3.4 route-map set-prepend out
 no auto-summary


access-list 130 permit ip host x.x.192.0 host 255.255.255.0
access-list 130 permit ip host x.x.201.0 host 255.255.255.0
access-list 130 permit ip host x.x.202.0 host 255.255.255.0
access-list 130 permit ip host x.x.205.0 host 255.255.255.0
access-list 130 permit ip host x.x.192.0 host 255.255.224.0
access-list 130 permit ip host x.x.206.0 host 255.255.255.0
access-list 130 permit ip host x.x.207.0 host 255.255.255.0
access-list 130 permit ip host x.x.209.0 host 255.255.255.0
access-list 131 permit ip host x.x.224.0 host 255.255.255.0
access-list 131 permit ip host x.x.225.0 host 255.255.255.0
access-list 131 permit ip host x.x.224.0 host 255.255.224.0
access-list 131 permit ip host x.x.160.0 host 255.255.224.0
access-list 131 permit ip host x.x.164.0 host 255.255.255.0
!
route-map set-prepend permit 10
 match ip address 130
!
route-map set-prepend permit 20
 description adding community attributes to ISP
 match ip address 131
 set as-path prepend abcde abcde abcde abcde abcde
 set community fghi:80

Comment
Watch Question

Top Expert 2009
Commented:
>If they don't match 130 do they then get checked against 131?
Yes.

>Why does the AS abcde get prepended 5 times?
AS abcde will be prepended to the routes matching access list 131.
This is done to make these prefixes less favorable via the neighbor/connection they are advertised out.

>What is the purpose of the route-map set-prepend?
Dual purpose.  The "10" statement is to simply advertise the routes matching access-list 130 with default attributes.
The "20" statement is to advertise the routes matching access-list 131 with your AS prepended 5 times and the community fghi:80 set.

Author

Commented:
thanks JFrederick29,

Very helpful.

I was looking at the acl 131 and the ip addresses don't have a network statement on this router.

I think those addresses may be at our other location that has a redundant connection to the Internet.

Does that sound right and if so what is the prepend and community doing?
Top Expert 2009
Commented:
Most likely this router is receiving these routes via iBGP from the 5.6.7.8 peer.  This does make sense as this router is intended to be the backup inbound path for those routes and the 5.6.7.8 router the primary.  I would expect the other router (5.6.7.8) to have the reverse meaning the 131 routes being announced with default attributes and the 130 routes having your AS prepended 5 times.

Author

Commented:
Do we even need acl 130?

It does not appear to be doing anything?


Wouldn't the routes get advertised with the defaults anyway?
Top Expert 2009
Commented:
It is acting as a filter so you are only advertising the routes you want advertised.  An outbound filter is always a good idea especially if receiving partial or full Internet routes.

Author

Commented:
Thanks,

So we are filtering the routes that we are advertising to our ISP?

I will do a sh ip route bgp to see what routes we are getting from the ISP.

Believe that we use a default route to the Internet so I don't think we are advertising any of those acl 131 routes back into our LAN.
Top Expert 2009
Commented:
Yes, exactly, you are filtering routes to your ISP.