Routing

Expand all | Collapse all

BGP with metric 2

Jump to Best Answer
  • 1.  BGP with metric 2

    Posted 03-13-2019 03:20

    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


    #BGP


  • 2.  RE: BGP with metric 2

    Posted 03-13-2019 03:53


  • 3.  RE: BGP with metric 2

    Posted 03-13-2019 05:27

    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.



  • 4.  RE: BGP with metric 2

    Posted 03-13-2019 18:52

    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



  • 5.  RE: BGP with metric 2

    Posted 03-14-2019 01:14
    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.


  • 6.  RE: BGP with metric 2
    Best Answer

     
    Posted 03-14-2019 05:59

    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



  • 7.  RE: BGP with metric 2

    Posted 03-14-2019 19:22

    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



  • 8.  RE: BGP with metric 2

     
    Posted 03-14-2019 20:23

    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).