Junos
Highlighted
Junos

Conditional Prefix for Backup BGP peer

[ Edited ]
‎01-11-2020 07:56 AM

I have two bgp peers but I can advertise routes to Backup Router only if the Main Router is down.

 

So I find out a interesting resource: conditional prefix installing:

https://www.juniper.net/documentation/en_US/junos/topics/concept/conditional-prefix-installing-overv...

 

But for that I need a route that is advertised only from Main router. Since both Main and backup router advertises the same routes, would be possible to generate a fake route from Main Router only if the bgp session is established?

 

6 REPLIES 6
Highlighted
Junos

Betreff: Conditional Prefix for Backup BGP peer

‎01-11-2020 08:38 AM

I don't really understand your request, hence my answer is a more generic BGP answer:

 

In general, in an active-passive scenario (BGP peer 1 is primary for ingress and egress traffic, BGP peer 2 is backup), all IP prefixes are advertised to both BGP peers at the same time. To perform traffic engineering, there are BGP attributes like local preference, as-path prepending and MED. In addition, the BGP peers may support BGP communities for further traffic engineering. With these attributes, in normal cases, you can define very well where your traffic shall come in and where it shall go out.

 

BGP should never announce any fake routes, it can only announce prefixes which are present in the local routing table.

--------------------------------------------------

If this solves your problem, please mark this post as "Accepted Solution".
If you think that my answer was helpful, please spend some Kudos.
Highlighted
Junos

Betreff: Conditional Prefix for Backup BGP peer

‎01-11-2020 10:23 AM
These attributes don't always work. Backup peer keeps sending me some
percentage of traffic. The only attribute that's works is split the prefix
in more specifics one. But I can't do that. So the conditional export can
work. If there is not a concept of fake routes maybe rib groups will do it.
Just more complex to configure.
Highlighted
Junos

Betreff: Conditional Prefix for Backup BGP peer

‎01-11-2020 10:59 AM

Then conditional advertisement is the right way:

https://www.juniper.net/documentation/en_US/junos/topics/example/conditional-prefix-installing-confi...

 

As this Techpub document is specifically for the case "advertise only when another prefix is in the routing table", here is some additional information for your use case:

https://forums.juniper.net/t5/Routing/any-equivalent-to-Cisco-s-advertise-map-lt-gt-non-exist-map-lt...

--------------------------------------------------

If this solves your problem, please mark this post as "Accepted Solution".
If you think that my answer was helpful, please spend some Kudos.
Highlighted
Junos

Betreff: Conditional Prefix for Backup BGP peer

‎01-11-2020 12:43 PM
In the cited use case the filter advertise only if routes is not in inet0
router table. But when primary bgp falls down wouldn'be the inet0 be
replaced with the routes from secondary peer anyway? Same import filter
since inbound routes are the same. In this case the routes always exists
and will advertise to secondary peer in any case. I think we need another
table. So how would be the best way to handle some routes and copy to
another table like inet0.test?
Highlighted
Junos

Betreff: Conditional Prefix for Backup BGP peer

[ Edited ]
‎01-11-2020 05:49 PM

setted a route with TEST-COMM and that do the trick:

 

set policy-options policy-statement TEST-import term a from instance master
set policy-options policy-statement TEST-import term a from protocol bgp
set policy-options policy-statement TEST-import term a from community TEST-COMM
set policy-options policy-statement TEST-import term a then accept
set policy-options policy-statement TEST-import term b then reject


set routing-instances TESTE instance-type virtual-router
set routing-instances TESTE routing-options instance-import TEST-import 

 

Highlighted
Junos

Betreff: Conditional Prefix for Backup BGP peer

‎01-12-2020 02:36 AM

Unfortunately this is one example of lacking documentation for JUNOS scenarios which are quite useful to know.

Fortunately, for other vendor's OS there are examples on the Internet how to achieve this. As you already mentioned, to check from which BGP peer your Router receives the IP prefix mentioned in the policy, inbound BGP communities are the right way. Just google for "BGP Conditional Advertisement" to get some examples for another major vendor's OS.

--------------------------------------------------

If this solves your problem, please mark this post as "Accepted Solution".
If you think that my answer was helpful, please spend some Kudos.
Feedback