Routing
Routing

BGP with metric 2

‎03-13-2019 03:20 AM

Hi 

 

My router got the same prefixe of the same ASN via eBGP from different sites. And transfers these routes via iBGP on my backbone.

 

For example, I learned google's routes from Japan and Hong Kong. But I wish some of my pops chose Google routes from Hong Kong, others chose from Japan.

 

How could I reach this goal ?  BGP metric 2 ?

 

Best Regards

Cloud

7 REPLIES 7
Routing

Re: BGP with metric 2

‎03-13-2019 03:52 AM
Routing

Re: BGP with metric 2

‎03-13-2019 05:27 AM

Hi,

If you don't want to take IGP metric into account then the easiest way is probably to add communities (via import policy on your eBGP neighbors) and then use those communities differently in iBGP import policy on your other routers.

Routing

Re: BGP with metric 2

[ Edited ]
‎03-13-2019 06:52 PM

Hi

 

I am just thinking can I use bgp's attribute - metric2 to control it ?

 

Because there are the same igp metric and local preference for google routes learning from Hong Kong and Japan.

So, I need metric2 or metric to force more shorter distance's routes or path having higher priority.

 

Is it possbile to get the goal ? Mean that choses by prefixes or community for defferent pops.

 

Cloud

Routing

Re: BGP with metric 2

‎03-14-2019 01:13 AM
Hi, >>> Because there are the same igp metric and local preference for google routes learning from Hong Kong and Japan. In this case I believe there is no way to differentiate those routes on different POPs other than using communities. Just add one community to routes received from HK, say 64512:1, and another to routes received from Japan, say 64512:2 in the eBGP import policy and then use them differently to change local preference in iBGP import policy on POPs.
Routing
Solution
Accepted by topic author Cloud
‎03-14-2019 08:35 PM

Re: BGP with metric 2

‎03-14-2019 05:58 AM

metric is the MED value and metric2 is IGP metric so that is not going to help you with your scenario.  You need to use communities and local-preference as other people who have responded are suggesting. It would be something like this:   

 

BGP.png

Yasmin Lara - Juniper Ambassador #QuadE - JNCIE-SP, JNCIE-ENT, JNCIE-DC, JNCIE-SEC
JNCIS-CLOUD, JNCDS-DC, JNCIA-DevOps
Routing

Re: BGP with metric 2

‎03-14-2019 07:21 PM

Hi 

 

As you guys sad, I have to use community string and local preference to match my purpose.

 

But I still have one question. What is function of bgp metric - metric4 ?

Since I saw it , but why can't use it ?

 

# set policy-options policy-statement AS16059-IN termAS16059-IN then ?

> metric Metric value
> metric2 Metric value 2
> metric3 Metric value 3
> metric4 Metric value 4

 

Best regards,

Cloud

Routing

Re: BGP with metric 2

‎03-14-2019 08:22 PM

They are not BGP attributes. The only one of those 4 metrics that you are seeing under the policy configuration, that applies to BGP, is metric (which is the MED). 

Yasmin Lara - Juniper Ambassador #QuadE - JNCIE-SP, JNCIE-ENT, JNCIE-DC, JNCIE-SEC
JNCIS-CLOUD, JNCDS-DC, JNCIA-DevOps