Solved

BGP - USING LOCAL_PREF & MED ATTRIBUTES

Posted on 2009-03-31
35
509 Views
Last Modified: 2012-08-14
after following instructions to configure configs on the 3 routers below:

- sanjose3 - is the main router
- ISP1A - another router
- ISP1B - another router

I have 2 questions:

1.  which path is better - i believe it to be 192.168.1.6 ?
2.  based on the output of the "sh ip bgp" command below, what is the local preference values of paths 1 & 2 - i believe at this point for the configurations done so far that there is currently only 1 local preference value, as i have not added any "Local_pref" configurations as yet.  would I be correct in thinking this?
-------------------------------------------
Building configuration...

Current configuration : 768 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname sanjose3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
!
interface Ethernet0
 ip address 200.100.50.1 255.255.255.0
!
 interface Serial0
 ip address 192.168.1.6 255.255.255.252
 clock rate 56000
 no fair-queue
!
interface Serial1
 ip address 172.24.1.17 255.255.255.252
 clock rate 56000
!
interface BRI0
 no ip address
 encapsulation hdlc
 shutdown
!
router bgp 300
 no synchronization
 bgp log-neighbor-changes
 network 200.100.50.0
 neighbor 172.24.1.18 remote-as 400
 neighbor 192.168.1.5 remote-as 200
 no auto-summary
!
ip http server
ip classless
!
!
!
!
line con 0
line aux 0
line vty 0 4
!
end

sanjose3#sh ip bgp
BGP table version is 2, local router ID is 192.168.1.6
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
*> 200.100.50.0     0.0.0.0                  0         32768 i
sanjose3#sh rip   ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    200.100.50.0/24 is directly connected, Ethernet0
     172.24.0.0/30 is subnetted, 1 subnets
C       172.24.1.16 is directly connected, Serial1
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.4 is directly connected, Serial0
sanjose3#
---------------------------------------------
Building configuration...

Current configuration : 661 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname ISP1A
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
!
interface Ethernet0
 no ip address
 shutdown
!
interface Serial0
 ip address 192.168.1.5 255.255.255.252
 no fair-queue
!
interface Serial1
 ip address 10.1.1.1 255.255.255.252
!
router bgp 200
 no synchronization
 bgp log-neighbor-changes
 network 10.0.0.0
 neighbor 10.1.1.2 remote-as 400
 neighbor 192.168.1.6 remote-as 300
 no auto-summary
!
ip http server
ip classless
!
!
!
!
line con 0
exec-timeout 0 0
line aux 0
line vty 0 4
!
end

ISP1A#sh ip bgp
BGP table version is 2, local router ID is 192.168.1.5
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
*> 200.100.50.0     192.168.1.6              0             0 300 i
ISP1A#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

B    200.100.50.0/24 [20/0] via 192.168.1.6, 00:07:41
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.4 is directly connected, Serial0
ISP1A#
-----------------------------------------------
Building configuration...

Current configuration : 723 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname ISP1B
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
!
interface Ethernet0
 no ip address
 shutdown
!
interface Serial0
 ip address 172.24.1.18 255.255.255.252
 no fair-queue
!
interface Serial1
 ip address 10.1.1.2 255.255.255.252
!
interface BRI0
 no ip address
 encapsulation hdlc
 shutdown
!
router bgp 400
 no synchronization
 bgp log-neighbor-changes
 network 10.0.0.0
 neighbor 10.1.1.1 remote-as 200
 neighbor 172.24.1.17 remote-as 300
 no auto-summary
!
ip http server
ip classless
!
!
!
!
line con 0
 exec-timeout 0 0
line aux 0
line vty 0 4
!
end

ISP1B#sh ip bgp
BGP table version is 2, local router ID is 172.24.1.18
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
*> 200.100.50.0     172.24.1.17              0             0 300 i
ISP1B#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

B    200.100.50.0/24 [20/0] via 172.24.1.17, 00:04:26
     172.24.0.0/30 is subnetted, 1 subnets
C       172.24.1.16 is directly connected, Serial0
ISP1B#
0
Comment
Question by:mikey250
  • 21
  • 14
35 Comments
 
LVL 43

Expert Comment

by:JFrederick29
ID: 24029489
1.  Assuming you are talking about the path to 200.100.50.0/24.  The path via 192.168.1.6 is the only path as the ISP1B router is not advertising that subnet.

2.  The local pref is the default of 100 since you don't have it configured otherwise.
0
 

Author Comment

by:mikey250
ID: 24029793
1. This is what I thought, it looks like my scenarios are a little back to front or maybe me?

2. when you say default 100 are you meaning if no commands regarding "local_Pref" are configured then a default of 100 is assummed although I cannot see this in config?

a. the reason why i say this is because one of the config commands for ISP1B - "neighbor 172.24.1.17 remote-as 300 should have been "neighbor 172.24.1.17 remote-as 100", but i thought "............ remote-as 300 was a typo or WASNT it?

3.  once ive cleared up those issues above, then i will THEN be adding a "local_pref" on ISP1A -
- which will force a specified route direction

- & eventually a "route-map badmetric", stopping ISP1A from routing via 192.168.1.6
- & then on ISP1B a "goodmetric" 172.24.1.17 out etc.

so as you can see im cross-checking my results!!
0
 
LVL 43

Expert Comment

by:JFrederick29
ID: 24029865
2.  Yes, default value is 100 so you won't see it in the BGP table/config.

a.  It should be 300 since sanjose3 has an AS number of 300.

3.  Add this to the ISP1B router so ISP1A has two paths to the 200.100.50.0/24 subnet.

ISP1B:

router bgp 400
network 200.100.50.0

Now, on ISP1A, you should see two entries in the BGP table under that subnet and it will prefer one of the two paths.  You can then use local pref to favor one way or the other.
0
 

Author Comment

by:mikey250
ID: 24029954
ive added on ISP1B, the command &

ISP1A#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

B    200.100.50.0/24 [20/0] via 192.168.1.6, 01:50:47
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.4 is directly connected, Serial0
ISP1A#sh ip bgp
BGP table version is 2, local router ID is 192.168.1.5
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
*> 200.100.50.0     192.168.1.6              0             0 300 i
ISP1A#

1. i will local pref later as presumably I should see two paths before I do that?
0
 

Author Comment

by:mikey250
ID: 24029977
the !sh ip bgp" are exactly as before!!
0
 
LVL 43

Expert Comment

by:JFrederick29
ID: 24029987
Well, look at the BGP and routing table on ISP1A now, you should see different results than before.
0
 

Author Comment

by:mikey250
ID: 24030024
ISP1A#sh ip bgp
BGP table version is 2, local router ID is 192.168.1.5
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
*> 200.100.50.0     192.168.1.6              0             0 300 i
ISP1A#
0
 
LVL 43

Expert Comment

by:JFrederick29
ID: 24030031
Oops, sorry, that was from ISP1A :)

Add this to ISP1A:

conf t
ip route 172.24.1.16 255.255.255.252 10.1.1.2

Then on ISP1A, do a "clear ip bgp neigh 10.1.1.2 soft in" command.
0
 

Author Comment

by:mikey250
ID: 24030046
1. or is it supposed to be to add the "Local_pref commands and or "goodmetric & badmetrick" to get that?
0
 
LVL 43

Expert Comment

by:JFrederick29
ID: 24030126
1.  Nope, you need two entries for the same network before local pref comes into play.
0
 

Author Comment

by:mikey250
ID: 24030224
do i remove or leave "the last command you said to enter?
0
 
LVL 43

Expert Comment

by:JFrederick29
ID: 24030241
On ISP1A:

Add the route:

conf t
ip route 172.24.1.16 255.255.255.252 10.1.1.2
exit

Then reset the peer session:

clear ip bgp neigh 10.1.1.2 soft in
0
 

Author Comment

by:mikey250
ID: 24030250
ISP1A#
!
interface Serial0
 ip address 192.168.1.5 255.255.255.252
 no fair-queue
!
interface Serial1
 ip address 10.1.1.1 255.255.255.252
!
router bgp 200
 no synchronization
 bgp log-neighbor-changes
 network 10.0.0.0
 neighbor 10.1.1.2 remote-as 400
 neighbor 192.168.1.6 remote-as 300
 no auto-summary
!
ip http server
ip classless
ip route 172.24.1.16 255.255.255.252 10.1.1.2
!
------------------
ISP1A#sh ip bgp
BGP table version is 1, local router ID is 192.168.1.5
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
*  200.100.50.0     192.168.1.6              0             0 300 i
ISP1A#
---------------------------------
 still same
0
 
LVL 43

Expert Comment

by:JFrederick29
ID: 24030277
Can you post a "show ip bgp neigh summary" from ISP1A.
0
 

Author Comment

by:mikey250
ID: 24030282
ISP1A#clear ip bgp neigh 10.1.1.2 soft in
                    ^
% Invalid input detected at '^' marker.

ISP1A#clear ip bgp * - so i did this command instead
ISP1A#
0
 
LVL 43

Expert Comment

by:JFrederick29
ID: 24030291
Sorry, I meant "show ip bgp summary".
0
 

Author Comment

by:mikey250
ID: 24030341
ISP1A#show ip bgp summary
BGP router identifier 192.168.1.5, local AS number 200
BGP table version is 1, main routing table version 1
1 network entries using 101 bytes of memory
1 path entries using 48 bytes of memory
1 BGP path attribute entries using 60 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 233 total bytes of memory
BGP activity 5/4 prefixes, 5/4 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

10.1.1.2        4   400       0       0        0    0    0 never    Idle
192.168.1.6     4   300     161     153        0    0    0 00:01:37        1
ISP1A#
0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 

Author Comment

by:mikey250
ID: 24030349
im not complaining, were working through it!!
0
 
LVL 43

Accepted Solution

by:
JFrederick29 earned 500 total points
ID: 24030398
Okay, well, the serial connection between ISP1A and ISP1B is not up.  Is it cabled correctly?
0
 

Author Comment

by:mikey250
ID: 24030444
it came loose!
0
 

Author Comment

by:mikey250
ID: 24030495
i removed that ip route 172.24.1.16 255.255.255.252 10.1.1.2

then did:

ISP1A#clear ip bgp *
ISP1A#clear ip bgp neigh 10.1.1.2 soft in
*Mar  1 02:48:22.231: %BGP-5-ADJCHANGE: neighbor 10.1.1.2 Down User reset
*Mar  1 02:48:22.239: %BGP-5-ADJCHANGE: nsh ip bgp

ISP1A#sh ip bgp

ISP1A#
*Mar  1 02:49:03.499: %BGP-5-ADJCHANGE: neighbor 192.168.1.6 Up
*Mar  1 02:49:09.727: %BGP-5-ADJCHANGE: neighbor 10.1.1.2 Up
ISP1A#sh ip bgp
BGP table version is 2, local router ID is 192.168.1.5
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
*  200.100.50.0     10.1.1.2                               0 400 300 i
*>                  192.168.1.6              0             0 300 i
ISP1A#
0
 

Author Comment

by:mikey250
ID: 24030547
so this is presumably the result I wanted, so i should be able to carryon?
0
 
LVL 43

Expert Comment

by:JFrederick29
ID: 24030558
Good, now you have two routes to 200.100.50.0.  The router has selected 192.168.1.6 as the best path as indicated by the > in front of the 192.168.1.6 next hop.

Now you can introduce local pref and other attributes to change the best path.
0
 
LVL 43

Expert Comment

by:JFrederick29
ID: 24030572
>so this is presumably the result I wanted, so i should be able to carryon?

Yes, correct.  Good luck.
0
 

Author Comment

by:mikey250
ID: 24030592
so the better path is 192.168.1.6 in the above case, but now ive done a

1. my next question is based on the output command below, what is the local preference value of paths 1 & 2.  im assuming is is in the order below: 10.1.1.2 then 192.168.1.6?
ISP1A#sh ip bgp 200.100.50.0

ISP1A#sh ip bgp 200.100.50.0
BGP routing table entry for 200.100.50.0/24, version 2
Paths: (2 available, best #2, table Default-IP-Routing-Table)
  Advertised to non peer-group peers:
  10.1.1.2
  400 300
    10.1.1.2 from 10.1.1.2 (172.24.1.18)
      Origin IGP, localpref 100, valid, external
  300
    192.168.1.6 from 192.168.1.6 (192.168.1.6)
      Origin IGP, metric 0, localpref 100, valid, external, best
ISP1A#
0
 

Author Comment

by:mikey250
ID: 24030608
1. thats what it says just before i add local pref or med for example?
0
 
LVL 43

Expert Comment

by:JFrederick29
ID: 24030614
Both have a localpref of 100 which again is the default value.  The highest localpref is favored so once you set higher localpref via the 10.1.1.2 peer, that will be the favored path over the current best path via 192.168.1.6.
0
 

Author Comment

by:mikey250
ID: 24030701
i can now see and I understand.  appreciated cheers!

1. but ive just removed:

router bgp 400
no network 200.100.50.0 - just to see & done the following, so im assuming this is ok, since obviously my serial cable came loose?

ISP1A#clear ip bgp *
ISP1A#sh ip bgp
*Mar  1 03:06:39.227: %BGP-5-ADJCHANGE: neighbor 192.168.1.6 Down User reset

ISP1A#sh ip bgp

ISP1A#
*Mar  1 03:07:06.983: %BGP-5-ADJCHANGE: neighbor 10.1.1.2 Up
*Mar  1 03:07:16.959: %BGP-5-ADJCHANGE: neighbor 192.168.1.6 Up
ISP1A#sh ip bgp
BGP table version is 3, local router ID is 192.168.1.5
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
*> 200.100.50.0     192.168.1.6              0             0 300 i
*                              10.1.1.2                                   0 400 300 i
ISP1A#
-------------
ISP1A#sh ip bgp
BGP table version is 3, local router ID is 192.168.1.5
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
*> 200.100.50.0     192.168.1.6              0             0 300 i
*                   10.1.1.2                               0 400 300 i
ISP1A#sh ip bgp 200.100.50.0
BGP routing table entry for 200.100.50.0/24, version 3
Paths: (2 available, best #1, table Default-IP-Routing-Table)
  Advertised to non peer-group peers:
  10.1.1.2
  300
    192.168.1.6 from 192.168.1.6 (192.168.1.6)
      Origin IGP, metric 0, localpref 100, valid, external, best
  400 300
    10.1.1.2 from 10.1.1.2 (172.24.1.18)
      Origin IGP, localpref 100, valid, external
ISP1A#
0
 
LVL 43

Expert Comment

by:JFrederick29
ID: 24030719
Yeah, looks good now.  The serial cable coming loose was the issue :)
0
 

Author Comment

by:mikey250
ID: 24030754
yes that why i thought id remove just to see.  sorted thanks!!
0
 

Author Comment

by:mikey250
ID: 24030787
how do i add points for this one, since my cable was loose. i could allocate the points but add a comment aswell.  what do you suggest?
0
 

Author Comment

by:mikey250
ID: 24030836
you walked me through changes to realise the serial cable so points are yours!
0
 
LVL 43

Expert Comment

by:JFrederick29
ID: 24030855
Thanks!
0
 

Author Comment

by:mikey250
ID: 24030879
oh yeh it was your comment about the serial cable that made us realise why.  so i will allocate points to that specific comment from you!!!!
0
 

Author Closing Comment

by:mikey250
ID: 31564827
ive removed those commands given and my config after all was correct. accept that as you suggested my serial cable had come loose.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are two basic ways to configure a static route for Cisco IOS devices. I've written this article to highlight a case study comparing the configuration of a static route using the next-hop IP and the configuration of a static route using an outg…
Tired of waiting for your show or movie to load?  Are buffering issues a constant problem with your internet connection?  Check this article out to see if these simple adjustments are the solution for you.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now