cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3969
Views
0
Helpful
5
Replies

BGP Path-prepend

Anukalp S
Level 1
Level 1

Hi.. I have a query.. i have gone through a router BGP configuration where under BGP there is route-map in inbound direction configured with AS-path prepend to make path less preferred and AS set as same on router.

Route is seeing routes from BGP peer, not sure why, isnt it kind of loop, in this case BGP should not receive prefix from peer. But router is receiving routes. Please help to clear this.

 

router bgp 65014

neighbor X.X.X.18 route-map BGP-IN in
neighbor X.X.X.18 route-map BGP-OUT  out

 

 

route-map BGP-IN permit 10
match community 23
set as-path prepend 65014 65014
set community no-export additive
route-map BGP-IN permit 20
match community SHN
set as-path prepend 65014 65014
set community no-export additive
route-map BGP-IN deny 500

 

 

 

5 Replies 5

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Anulkap,

the check on the BGP AS path attribute is made on the original received advertisement and it passes it, the route-map inbound performs AS path prepending later.

This is the only possible explanation of why prefixes are still accepted.

You should check with

show ip bgp neighbor x.x.x.18 received-routes

 

To be noted by setting BGP community to NO-EXPORT these prefixes are not advertised to any eBGP peer.

 

Hope to help

Giuseppe

 

Thanks Giuseppe.. could you explain in depth here.. you mean to say since there is match community command is placed here that's why prefix is being received. This command eliminating AS-path prepend and taking precendence over AS-path prepend. Is it correct?

 

show ip bgp neighbor x.x.x.18 received-routes shows prefixes being received.

Hello Anulkap,

I mean that if the check is performed on received routes BEFORE AS path prepending the routes can be accepted.

The note about BGP communitty NO-EXPORT is a side note.

 

Hope to help

Giuseppe

 

Hello

As your pre-pending ingress you may need to use the set as-path last-as option to prepend on in the incoming routes 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Thanks but my concern is here that why BGP is receiving routes from peer in this case. We have set AS-path prepend in inbound direction with same AS number. So router should see here same AS and it should consider it as loop due to same AS and drop prefixe. But router is receiving prefixes here.