We have completed the upgrade of IEOC! All posts, comments and user profiles have been migrated. For security reasons, we have reset all passwords. To set a new password please Click Here. Further updates soon to follow.

iBGP vs eBGP Admin Distance

if you have a router which has learned the same prefix by both an eBGP and a iBGP neighbor at which point does the Admin distance between the two come into play?   Does it take place before the BGP path selection process, and subsequently insert the eBGP route into the routing table because 20 beats 200, or does it take place at step number 7 of the BGP path selection process?

If the former, is the only way to get the router to prefer the iBGP route thru manipulating the AD?

Comments

  • Sorry, wrong forum, meant for RS

  • Hi,

    It takes place at step number 7 of the BGP best path selection algorithm.

    HTH

    Good luck!

  • Hi Brian

    In INE mock labs, for RTBH tasks, we inserts IBGP routes that should takes precedence EBGP routes. I have t always seen that IBGP routes taking precedence over EBGP routes at step 7.

    AD plays role in the routing table but it doesn't matter as the IBGP takes over EBGP route in the BGP table itself.

     

    Please let me your thought.s


    BGP path selection
    =============

    #1 Weight — This is a Cisco-defined attribute that is assigned locally to your router and does not get carried through to the router updates. If there are multiple paths to a particular IP address (which is very common), then BGP looks for the path with the highest weight. There are several ways to set the weight parameter, such as the neighbor command, the as-path access list, or route maps.

    #2 Local Preference — This is an indicator to the AS as to which path has local preference, with the highest preference being preferred. The default is 100. For example:

    bgp default local-preference 150

    #3 Network or Aggregate — This criterion prefers the path that was locally originated via a network or aggregate. The aggregation of specific routes into one route is very efficient and saves space on your network. For more information on aggregate, please see the Cisco article “Understanding Route Aggregation in BGP.”

    #4 Shortest AS_PATH — BGP uses this one only when there is a “tie” comparing weight, local preference, and locally originated vs. aggregate addresses.

    #5 Lowest origin type — This deals with protocols such as Interior Gateway Protocol (IGP) being a lower preference than Exterior Gateway Protocol (EGP).

    #6 Lowest multi-exit discriminator (MED) — This is also known as the external metric of a route. A lower MED value is preferred over a higher value.

    #7 eBGP over iBGP — Similar to #5, BGP AS Path prefers eBGP over iBGP.

    #8 Lowest IGP metric — This criterion prefers the path with the lowest IGP metric to the BGP next hop.

    #9 Multiple paths — This determines if multiple paths require installation in the routing table. Check out this link for information on BGP Multipath.

    #10 External paths — When both paths are external, it prefers the path that was received first (the oldest one).

    #11 Lowest router ID — This prefers the route that comes from the BGP router with the lowest router ID.

    #12 Minimum cluster list — If the originator or router ID is the same for multiple paths, it prefers the path with the minimum cluster list length.

    #13 Lowest neighbor address — This prefers the path that comes from the lowest neighbor address.

     

     

    With regards

    Kings

  • EBGP is preferred over iBGP, not the other way around.  This is why with RTBH the local preference is set higher, so the iBGP route is preferred over EBGP or other possible paths.

     

    Brian McGahan, CCIE #8593 (R&S/SP/Security)

    bmcgahan@INE.com

     

    Internetwork Expert, Inc.

    http://www.INE.com

     

    From: ccie-sc@ieoc.com [mailto:ccie-sc@ieoc.com] On Behalf Of Kingsley
    Sent: Friday, June 29, 2012 11:24 PM
    To: Brian McGahan
    Subject: Re: [CCIE Sec] RE: iBGP vs eBGP Admin Distance

     

    Hi Brian

    In INE mock labs, for RTBH tasks, we inserts IBGP routes that should takes precedence EBGP routes. I have t always seen that IBGP routes taking precedence over EBGP routes at step 7.

    AD plays role in the routing table but it doesn't matter as the IBGP takes over EBGP route in the BGP table itself.

     

    Please let me your thought.s


    BGP path selection
    =============

    #1 Weight — This is a Cisco-defined attribute that is assigned locally to your router and does not get carried through to the router updates. If there are multiple paths to a particular IP address (which is very common), then BGP looks for the path with the highest weight. There are several ways to set the weight parameter, such as the neighbor command, the as-path access list, or route maps.

    #2 Local Preference — This is an indicator to the AS as to which path has local preference, with the highest preference being preferred. The default is 100. For example:

    bgp default local-preference 150

    #3 Network or Aggregate — This criterion prefers the path that was locally originated via a network or aggregate. The aggregation of specific routes into one route is very efficient and saves space on your network. For more information on aggregate, please see the Cisco article “Understanding Route Aggregation in BGP.”

    #4 Shortest AS_PATH — BGP uses this one only when there is a “tie” comparing weight, local preference, and locally originated vs. aggregate addresses.

    #5 Lowest origin type — This deals with protocols such as Interior Gateway Protocol (IGP) being a lower preference than Exterior Gateway Protocol (EGP).

    #6 Lowest multi-exit discriminator (MED) — This is also known as the external metric of a route. A lower MED value is preferred over a higher value.

    #7 eBGP over iBGP — Similar to #5, BGP AS Path prefers eBGP over iBGP.

    #8 Lowest IGP metric — This criterion prefers the path with the lowest IGP metric to the BGP next hop.

    #9 Multiple paths — This determines if multiple paths require installation in the routing table. Check out this link for information on BGP Multipath.

    #10 External paths — When both paths are external, it prefers the path that was received first (the oldest one).

    #11 Lowest router ID — This prefers the route that comes from the BGP router with the lowest router ID.

    #12 Minimum cluster list — If the originator or router ID is the same for multiple paths, it prefers the path with the minimum cluster list length.

    #13 Lowest neighbor address — This prefers the path that comes from the lowest neighbor address.

     

     

    With regards

    Kings




    INE - The Industry Leader in CCIE Preparation
    http://www.INE.com

    Subscription information may be found at:
    http://www.ieoc.com/forums/ForumSubscriptions.aspx

  • My bad, I was doing parallel tasks, so totally wrote something incorrect.

    It's the local precedence that does the trick. Step 7 clearly says EBGP takes over IBGP.

    The local precedence makes IBGP take over EBGP.

     

    Earlier you were saying IBGP and EBGP are never compared. I wanted to tell that in RTBH, we do compare IBGP and EBGP.

     

    With regards

    Kings

  • Earlier you were saying IBGP and EBGP are never compared.

     

    Brian actually said, 'iBGP and EBGP distances are never compared for the same prefix.'

     

  • Accepted :-)

    This is was real nice discussion.

     

    With regards

    Kings

  • CE2(config-router)#do show ip bgp 111.111.111.1
    BGP routing table entry for 111.111.111.1/32, version 13
    Paths: (2 available, best #2, table default)
      Advertised to update-groups:
         6
      Refresh Epoch 1
      1234
        128.208.1.4 from 128.208.1.4 (4.4.4.4)
          Origin IGP, metric 0, localpref 100, valid, external
      Refresh Epoch 1
      Local
        1.1.1.1 (metric 11) from 1.1.1.1 (1.1.1.1)
          Origin IGP, metric 0, localpref 100, valid, internal, best

    CE2(config-router)#do show ip bgp
    BGP table version is 13, local router ID is 2.2.2.2
    Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
                  r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
                  x best-external, a additional-path, c RIB-compressed,
    Origin codes: i - IGP, e - EGP, ? - incomplete
    RPKI validation codes: V valid, I invalid, N Not found

         Network                   Next Hop            Metric  LocPrf Weight Path
     *   111.111.111.1/32   128.208.1.4              0                0     1234 i
     *>i                             1.1.1.1                     0    100       0     i

     

    Anyone can help me understand why the internal is selected instead of the external as shown above. Is it because of shorter AS_PATH ?  If it is, when will eBGP be preferred over iBGP ?

     

    thanks a lot in advance !!

Sign In or Register to comment.