Routing

 View Only
last person joined: 2 days ago 

Ask questions and share experiences about ACX Series, CTP Series, MX Series, PTX Series, SSR Series, JRR Series, and all things routing, including portfolios and protocols.
  • 1.  Local preference atribute

    Posted 04-30-2021 11:07
    Given this article:

    Example: Configuring BGP Local Preference

    If the local preference is modified on R3 and iBGP send local preference to all iBGP neighbours, does this mean that under default condition with only local preference altered to 300, if R2 will want to send traffic to R4, does this mean it will follow the following path to R4 : R2 -> R1 -> R3 -> R4?

    Thanks you.


    ------------------------------
    ALEXANDRU MINZAT
    ------------------------------


  • 2.  RE: Local preference atribute

    Posted 04-30-2021 20:22
    The key to understanding here is the first word LOCAL preference.

    The node and the node alone sets and uses local preference.  This is NOT part of what is advertised to neighbors either iBGP or eBGP.  

    Local preference is used only by the local host to influence how it selects egress route choice.

    ------------------------------
    Steve Puluka BSEET - Juniper Ambassador
    IP Architect - DQE Communications Pittsburgh, PA (Metro Ethernet & ISP)
    http://puluka.com/home
    ------------------------------



  • 3.  RE: Local preference atribute

    Posted 05-03-2021 03:36
    Hello,

    We know that local preference is local to the AS, and it wont leave the AS, so it is specific to iBGP peers.
    Since R3 have iBGP sessions with R1 and R2, it will advertise the routes received from R4 to both R1 and R2 since it is full mesh.
    If I check the best route selection algorithm:

    1. Verify that the next hop can be resolved.
    2. Choose the path with the lowest preference value (routing protocol process preference).

      Routes that are not eligible to be used for forwarding (for example, because they were rejected by routing policy or because a next hop is inaccessible) have a preference of –1 and are never chosen.

    3. Prefer the path with higher local preference.

    Since both iBGP and eBGP have the same route preference value of 170 and it is the same it will move to the 3rd tiebreaker which is local preference, where R3 have the highest one = 300, and it should be chosen as the best path.
    So R2 will see as the best path R2 -> R1 -> R3 -> R4.

    Am i missing something?

    ------------------------------
    ALEXANDRU MINZAT
    ------------------------------



  • 4.  RE: Local preference atribute

    Posted 05-01-2021 01:55
    Edited by aaron.gould 05-01-2021 01:55

    I understand local preference is local to the AS in which it is configured.... and so is advertised to all local i-bgp peers...

    https://www.juniper.net/documentation/us/en/software/junos/bgp/topics/ref/statement/local-preference-edit-protocols-bgp.html
    "The LOCAL_PREF path attribute always is advertised to internal BGP peers and to neighboring confederations. It is never advertised to external BGP peers."

    Also, a router will chose ebgp learned paths over ibgp learned paths.

    So it seems that if R2 is learning about reachability to R4 via ebgp between AS 123 and AS 4... and R2 is also learning about R4 reachability via it's local ibgp sessions.... R2 will choose its ebgp learned path, and so the local pref you mention is not regarded at all

    https://www.juniper.net/documentation/en_US/junos/topics/topic-map/bgp-route-preference.html#jd0e506
    "...Junos OS always prefers EBGP routes over IBGP routes"




    ------------------------------
    Aaron Gould
    Senior Network Engineer
    aaron@gvtc.com
    https://www.linkedin.com/in/agould123/
    ------------------------------



  • 5.  RE: Local preference atribute

    Posted 05-03-2021 03:39
    Hello,

    We know that local preference is local to the AS, and it wont leave the AS, so it is specific to iBGP peers.
    Since R3 have iBGP sessions with R1 and R2, it will advertise the routes received from R4 to both R1 and R2 since it is full mesh.
    If I check the best route selection algorithm:

    1. Verify that the next hop can be resolved.
    2. Choose the path with the lowest preference value (routing protocol process preference).

      Routes that are not eligible to be used for forwarding (for example, because they were rejected by routing policy or because a next hop is inaccessible) have a preference of –1 and are never chosen.

    3. Prefer the path with higher local preference.

    Since both iBGP and eBGP have the same route preference value of 170 and it is the same it will move to the 3rd tiebreaker which is local preference, where R3 have the highest one = 300, and it should be chosen as the best path.
    So R2 will see as the best path R2 -> R1 -> R3 -> R4.

    Am i missing something?

    ------------------------------
    ALEXANDRU MINZAT
    ------------------------------



  • 6.  RE: Local preference atribute

    Posted 05-03-2021 09:08
    Alexandru...You are correct in your understanding.  Since R4 is peered to R2 and R3, they each receive the same routes that R4 is sending.  But you may want to favor the path via R3 to R4(for whatever reason), so how you force traffic to forward accordingly is to set the local preference higher via an import policy on R3 for routes from R4, and then when R3 announces those routes to the iBGP peers, they will receive the routes w/ the modified LP (300 in your example above).  When R2 looks in it's routing table, it'll see a path via R4 directly or via R3.  B/c the path via R3 has a higher LP, R2 will choose that path.


  • 7.  RE: Local preference atribute

    Posted 05-03-2021 10:40
    Hi,

    Thank you for the answer, I was looking at that setup and was wandering what will happen in the rest of the network (not necessarily a real life example)

    ------------------------------
    ALEXANDRU MINZAT
    ------------------------------