08-28-2019 05:03 AM
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
08-28-2019 05:16 AM - edited 08-28-2019 05:17 AM
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
08-28-2019 06:46 AM
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.
08-28-2019 07:16 AM
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
08-28-2019 07:11 AM
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
08-28-2019 07:18 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide