Assume a simplified case in which router R1 is connected to two BGP peers: one eBGP peer and one iBGP peer. Is there a possibility to advertise directly connected routes only to one of them automatically i.e. whenever a new directly connected network to R1 appears it is advertised only to one of BGP peers while the other peer receives other routes but not those that are directly connected to R1?

  • You can add a filter to either or both neighbors. The iBGP neighbor should be learning the networks from an IGP, which would normally be more preferred than iBGP. Also, a neighbor learning prefixes from iBGP cannot advertise those prefixes to other iBGP neighbors, so the iBGP neighbor could not then advertise the prefixes learned from R1 via iBGP to any other neighbor via iBGP.
    – Ron Maupin
    Oct 13, 2020 at 20:48

2 Answers 2


Yes, absolutely; there are a variety of ways to accomplish this. I'll suggest two just to give you some inspiration.

Match Protocol option

On your route-map toward the BGP neighbors, you can match protocol connected in a stanza to determine whether you propagate those routes. For example:

route-map to-isp deny 100
  description don't announce my connected routes to the ISP
  match protocol connected

Community option

When redistributing connected into BGP, add a community to the routes so you can match on it.

ip community-list standard internal-routes permit 65000:10

route-map connected-to-bgp permit 100
  set community 65000:10

route-map to-isp deny 100
  match community internal-routes


It will be dependent on the exact operating system that runs on the router, but generally redistribution is configured on the router level. I.E. apply to all peers.

You can however filters routes that are announced to peers based on various criteria, and especially communities.

So one way of doing this is:

  • apply a route-map on the "redistribute connected" statement. This route map set a community. So all routes that are redistributed now have this label on them.
  • apply a route-map to the routes announced to peer A to allow this community.
  • apply a route-map to the routes announced to peer B to deny this community.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.