14 Replies Latest reply: Feb 26, 2012 4:49 PM by Joel Shrestha RSS

    BGP Weight Default

    Wireless Mouse

      Hello,

       

      The weight attribute is a Cisco proprietary technology and considered as first attribute in BGP. The default value of weight is 0 and the range is from 0 to 65535. If we change the weight value of one router that change will not propagate to other router and the route with maximum weight value will be considered as the best route.

       

      ok fair enough, I have routers CME and R5 and I will show you the Show ver  and show ip bgp for both of them

       

       

      CME#show ver

      Cisco IOS Software, 2800 Software (C2800NM-ADVENTERPRISEK9-M), Version 12.4(22)T, RELEASE SOFTWARE (fc1)

       


      CME#show ip bgp
      BGP table version is 8, local router ID is 4.4.4.4
      Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
                    r RIB-failure, S Stale
      Origin codes: i - IGP, e - EGP, ? - incomplete

         Network          Next Hop            Metric LocPrf Weight Path
      r> 10.1.45.0/24     10.1.45.2                0             0 6500 ?
      *> 50.1.1.0/24      10.1.45.2                0             0 6500 i
      *> 200.1.1.0        10.1.45.2                0             0 6500 ?
      *> 200.1.2.0        10.1.45.2                0             0 6500 ?
      *> 200.1.3.0        10.1.45.2                0             0 6500 ?
      *> 200.1.4.0        10.1.45.2                0             0 6500 ?

       

      R5#show ver

      Cisco IOS Software, C2600 Software (C2600-ADVENTERPRISEK9-M), Version 12.4(15)T4, RELEASE SOFTWARE (fc2)


      R5#show ip bgp
      BGP table version is 9, local router ID is 200.1.6.1
      Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
                    r RIB-failure, S Stale
      Origin codes: i - IGP, e - EGP, ? - incomplete

         Network          Next Hop            Metric LocPrf Weight Path
      *> 10.1.45.0/24     0.0.0.0                  0         32768 ?
      *> 50.1.1.0/24      0.0.0.0                  0         32768 i
      *> 200.1.1.0        0.0.0.0                  0         32768 ?
      *> 200.1.2.0        0.0.0.0                  0         32768 ?
      *> 200.1.3.0        0.0.0.0                  0         32768 ?
      *> 200.1.4.0        0.0.0.0                  0         32768 ?

       

       

      Both routers have the same IOS and I have never configured Weight on either of these two routers...Was not the defaults 0? I read in somewhere that deafult is 32,768 like in one of my router show. I am confused!

       

      How can be the default weight be different in each router when the IOS version is the12.4 on both of the routers?

        • 1. Re: BGP Weight Default
          tnewshott

          Here is a link that should explain it better for you: http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a00800c95bb.shtml#weight

           

          Your BGP output shows an AS_PATH on CME, but not on R5.  This tells me that the routes are being originated on R5 somehow(either redistribution or a network command under BGP).  This would explain the result of your output.

           

          Please let us know if you need any furhter clarification!

          • 2. Re: BGP Weight Default
            Joel Shrestha

            weight is zero for learned routes and 32768 for locally injected routes.

            HTH

            Joel

            • 3. Re: BGP Weight Default
              Wireless Mouse

              thanks, one final question why the loc prf is empty? should not have 100 as its the factory default...anyway I changed the local prefence to 50 ( bgp default local-preference 50) and still showing empty...why?

              • 4. Re: BGP Weight Default
                Beau Yancy

                I believe it depends on the IOS version whether it will display the local preference of a route that is at its default value. By you using the command "bgp default local-preference 50" you have now set it to a new DEFAULT value so in your version it looks like it still isn't displaying it. If you change some routes local preference to something other than the configured default then you will see it listed.

                 

                - Beau

                • 5. Re: BGP Weight Default
                  Beau Yancy

                  Also, if you want to see the local preference regardless, you can use the "show ip bgp x.x.x.x" to see the specific route in slightly more detail. This will include the local preference anyway whether it is at the default value or otherwise.

                  • 6. Re: BGP Weight Default
                    Wireless Mouse

                    Sorry I did not get you Beau...I did change to something different that the configured default and still not showing as I said I changed to 50, Can you explain again with an example please

                    • 7. Re: BGP Weight Default
                      Beau Yancy

                      Scratch what I said before. I confused myself!

                       

                      So, it seems that you only see the local preference value in the "show ip bgp" if that route was received from an iBGP peer (makes sense). Otherwise, if recieved from an eBGP peer, the value will be displayed if the local preference was set to a different than default value inbound on the local device.

                       

                      Capture.PNG

                       

                      For instance, below R3 is receiving all of its routes from an eBGP peer (R1). Notice the only route with the local preference displayed is 112.0.0.0 which I have configured a route-map inbound to the eBGP peer to change it to 250.

                       

                      Rack1R3#sho ip bgp

                      BGP table version is 92, local router ID is 150.1.3.3

                      Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

                                    r RIB-failure, S Stale

                      Origin codes: i - IGP, e - EGP, ? - incomplete

                       

                         Network          Next Hop            Metric LocPrf Weight Path

                      *> 28.119.16.0/24   163.1.13.1                             0 100 54 i

                      *> 28.119.17.0/24   163.1.13.1                             0 100 54 i

                      *> 112.0.0.0        163.1.13.1                    250      0 100 54 50 60 i

                      *> 113.0.0.0        163.1.13.1                             0 100 54 50 60 i

                      *> 114.0.0.0        163.1.13.1                             0 100 54 i

                      *> 115.0.0.0        163.1.13.1                             0 100 54 i

                      *> 116.0.0.0        163.1.13.1                             0 100 54 i

                      *> 117.0.0.0        163.1.13.1                             0 100 54 i

                      *> 118.0.0.0        163.1.13.1                             0 100 54 i

                      *> 119.0.0.0        163.1.13.1                             0 100 54 i

                       

                      SW2 is an iBGP with R3. Notice that all the routes learned from this iBGP have the local preference value displayed in the output in addition to the 250 that I manually set.

                       

                      Rack1SW2#sho ip bgp

                      BGP table version is 92, local router ID is 150.1.8.8

                      Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

                                    r RIB-failure, S Stale

                      Origin codes: i - IGP, e - EGP, ? - incomplete

                       

                         Network          Next Hop            Metric LocPrf Weight Path

                      *>i28.119.16.0/24   163.1.13.1               0    100      0 100 54 i

                      *>i28.119.17.0/24   163.1.13.1               0    100      0 100 54 i

                      *>i112.0.0.0        163.1.13.1               0    250      0 100 54 50 60 i

                      *>i113.0.0.0        163.1.13.1               0    100      0 100 54 50 60 i

                      *>i114.0.0.0        163.1.13.1               0    100      0 100 54 i

                      *>i115.0.0.0        163.1.13.1               0    100      0 100 54 i

                      *>i116.0.0.0        163.1.13.1               0    100      0 100 54 i

                      *>i117.0.0.0        163.1.13.1               0    100      0 100 54 i

                      *>i118.0.0.0        163.1.13.1               0    100      0 100 54 i

                      *>i119.0.0.0        163.1.13.1               0    100      0 100 54 i

                       

                      Sorry for the previous confusion. I had to lab this up myself to check why. So, there it is.

                       

                      -Beau

                      • 8. Re: BGP Weight Default
                        Martin

                        that local pref drives me nutts too; sometimes shows up and sometimes doesn't; go figure;

                        btw. what happened to Fabio?;

                        • 9. Re: BGP Weight Default
                          Wireless Mouse

                          Thanks Beau very good explanation , your previous explanation was good too and it worked

                           

                           

                          CME#show ip bgp 10.1.45.2

                          BGP routing table entry for 10.1.45.0/24, version 9

                          Paths: (1 available, best #1, table Default-IP-Routing-Table, RIB-failure(17))

                            Advertised to update-groups:

                                  2

                            6500

                              10.1.45.2 from 10.1.45.2 (200.1.6.1)

                                Origin incomplete, metric 0, localpref 50, valid, external, best

                           

                          strange that with show ip bgp is not showing!

                           

                          Martin why are you asking me about Favio and his best friend goodboy, I have nothing to do with them and when I see their post in my  email I just move on to the next..poor guys I think they were having antipsychotic medication. I am glad they are not coming here any more as sometimes when by mistake I read one of their post I thought it was me in need of antipsychotic!! Lets pray to God these two guys are not coming here anymore!!!

                           

                          favio: goodboy why this 1_2_3 hate us so much?

                           

                          goodboy: it must be that he is a simple man as the number 1,2 and 3!

                           

                          favio: Ha,ha,ha!  By the way is good to know that Martin ask for us.

                           

                          goodboy: Yes, that means he missed us

                           

                          1_2_3 : You crazy guys get out of my post, you are giving me bad reputation!!

                          ·   

                          • 10. Re: BGP Weight Default
                            Joel Shrestha

                            Local pref is significant to local AS only. So, updates received from eBGP peer do not include the LocalPref number, that's why IOS list the null value for the updates received from eBGP peer, Since the scope of the LocalPref is within an AS,  IOS does include the default LocalPref value in iBGP updates, which is 100.

                             

                            Joel

                            • 11. Re: BGP Weight Default
                              Wireless Mouse

                              yes but Local pref is showing in show ip bgp 10.1.45.2 but not in show ip bgp...so in one is present and not in the other one.  . And I have two routers configured with EBGP..two routers in two different AS

                              • 12. Re: BGP Weight Default
                                Beau Yancy

                                Yep, have you tried configuring them as iBGP peers just to test out the "show ip bgp" output. You should then see the local preference then on whichever router is receiving those routes from the iBGP peer.

                                 

                                It's pretty interesting behavior of that command specifically.

                                • 13. Re: BGP Weight Default
                                  Wireless Mouse

                                  Beau, Now I have configured them as iBGP and ......in one of them you can see the LocPrf and in the other you can't

                                   

                                  CME#show ip bgp
                                  BGP table version is 8, local router ID is 4.4.4.4
                                  Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
                                                r RIB-failure, S Stale
                                  Origin codes: i - IGP, e - EGP, ? - incomplete

                                     Network          Next Hop            Metric LocPrf Weight Path
                                  r>i10.1.45.0/24     10.1.45.2                0    100      0 ?
                                  *>i50.1.1.0/24      10.1.45.2                0    100      0 i
                                  *>i200.1.1.0        10.1.45.2                0    100      0 ?
                                  *>i200.1.2.0        10.1.45.2                0    100      0 ?
                                  *>i200.1.3.0        10.1.45.2                0    100      0 ?
                                  *>i200.1.4.0        10.1.45.2                0    100      0 ?

                                   


                                  R5#show ip bgp
                                  BGP table version is 7, local router ID is 200.1.6.1
                                  Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
                                                r RIB-failure, S Stale
                                  Origin codes: i - IGP, e - EGP, ? - incomplete

                                     Network          Next Hop            Metric LocPrf Weight Path
                                  *> 10.1.45.0/24     0.0.0.0                  0         32768 ?
                                  *> 50.1.1.0/24      0.0.0.0                  0         32768 i
                                  *> 200.1.1.0        0.0.0.0                  0         32768 ?
                                  *> 200.1.2.0        0.0.0.0                  0         32768 ?
                                  *> 200.1.3.0        0.0.0.0                  0         32768 ?
                                  *> 200.1.4.0        0.0.0.0                  0         32768 ?

                                   

                                  I will give you the conf of both routers:

                                   

                                  R5:

                                   

                                  router bgp 6500

                                  no synchronization

                                  bgp log-neighbor-changes

                                  network 50.0.0.0

                                  network 50.1.1.0 mask 255.255.255.0

                                  redistribute connected route-map FILTER

                                  neighbor 10.1.45.1 remote-as 6500

                                  no auto-summary

                                  !

                                  ip forward-protocol nd

                                  ip route 4.4.4.4 255.255.255.255 10.1.45.1

                                  !

                                  !

                                  ip http server

                                  no ip http secure-server

                                  !

                                  access-list 50 deny   200.1.5.0

                                  access-list 50 deny   200.1.6.0

                                  access-list 50 permit any

                                  !

                                  !

                                  !

                                  route-map FILTER permit 10

                                  match ip address 50

                                   

                                  CME:

                                   

                                  router bgp 6500

                                  no synchronization

                                  bgp log-neighbor-changes

                                  neighbor 1.1.1.1 remote-as 6500

                                  neighbor 1.1.1.1 update-source Loopback4

                                  neighbor 10.1.45.2 remote-as 6500

                                  no auto-summary

                                  • 14. Re: BGP Weight Default
                                    Joel Shrestha

                                    I didn't read all the posts before.....and you're right, it does show the local preference when you look for specific prefix in the BGP table......not sure why.....