My Countingdown

Thursday, December 15, 2011

Lab 8. BGP using Weight


Now, we’ll try to do lab using Weight. Weight is Cisco proprietary. Wight is used to influence outbound traffic. For example this lab if we see R100 to R500 will go via R1 and R4 because the AS Path is smaller than other way with assumption all mark is default. Please refer to BGP summary regarding path selection in BGP! --> http://pursuingmydestiny.blogspot.com/2011/12/bgp-summary.html

Let’s make the lab

R1#
interface loopback 0
  ip address 1.1.1.1 255.255.255.255
interface f0/0
  ip address 14.14.14.1 255.255.255.0
  no shu
interface f0/1
  ip address 12.12.12.1 255.255.255.0
  no shu
interface s0/0
  ip address 110.110.110.1 255.255.255.0
  no shut
router bgp 12
  neighbor 12.12.12.2 remote-as 12
  neighbor 12.12.12.2 next-hop-self
  neighbor 14.14.14.4 remote-as 34
  neighbor 110.110.110.10 remote-as 100
  network 1.1.1.1 mask 255.255.255.255

R2#
interface loopback 0
  ip address 2.2.2.2 255.255.255.255
interface f0/0
  ip address 23.23.23.2 255.255.255.0
  no shu
interface f0/1
  ip address 12.12.12.2 255.255.255.0
  no shu
router bgp 12
  neighbor 12.12.12.1 remote-as 12
  neighbor 12.12.12.1 next-hop-self
  neighbor 23.23.23.3 remote-as 34
  network 2.2.2.2 mask 255.255.255.255
 
R3#
interface loopback 0
  ip address 3.3.3.3 255.255.255.255
interface f0/0
  ip address 23.23.23.3 255.255.255.0
  no shu
interface f0/1
  ip address 34.34.34.3 255.255.255.0
  no shu
router bgp 34
  neighbor 23.23.23.2 remote-as 12
  neighbor 34.34.34.4 remote-as 34
  neighbor 34.34.34.4 next-hop-self
  network 3.3.3.3 mask 255.255.255.255

R4#
interface loopback 0
  ip address 4.4.4.4 255.255.255.255
interface f0/0
  ip address 14.14.14.4 255.255.255.0
  no shu
interface f0/1
  ip address 34.34.34.4 255.255.255.0
  no shu
interface s0/0
  ip address 150.150.150.4 255.255.255.0
  no shut
router bgp 34
  neighbor 14.14.14.1 remote-as 12
  neighbor 34.34.34.3 remote-as 34
  neighbor 34.34.34.3 next-hop-self
  neighbor 150.150.150.50 remote-as 500
  network 4.4.4.4 mask 255.255.255.255

R100#
interface loopback 0
  ip address 10.10.10.10 255.255.255.255
interface s0/0
  ip address 110.110.110.10 255.255.255.0
  no shut
router bgp 100
  neighbor 110.110.110.1 remote-as 12
  network 10.10.10.10 mask 255.255.255.255

R500#
interface loopback 0
  ip address 50.50.50.50 255.255.255.255
interface s0/0
  ip address 150.150.150.50 255.255.255.0
  no shut
router bgp 500
  neighbor 150.150.150.4 remote-as 34
  network 50.50.50.50 mask 255.255.255.255

Let’s check routing table to R500 in R1

R1(config-router)#do sh ip bgp 50.50.50.50
BGP routing table entry for 50.50.50.50/32, version 7
Paths: (2 available, best #2, table Default-IP-Routing-Table)
  Advertised to update-groups:
        1    2
  34 500
    12.12.12.2 from 12.12.12.2 (2.2.2.2)
      Origin IGP, metric 0, localpref 100, valid, internal
  34 500
    14.14.14.4 from 14.14.14.4 (4.4.4.4)
      Origin IGP, localpref 100, valid, external, best           --- > by default will choose via R1-R4

Let’s check trace route from R100 to R500

R100(config-router)#do tracer 50.50.50.50 sour 10.10.10.10
Type escape sequence to abort.
Tracing the route to 50.50.50.50

  1 110.110.110.1 4 msec 72 msec 68 msec
  2 14.14.14.4 60 msec 48 msec 88 msec
  3 150.150.150.50 160 msec *  60 msec

So let’s make change path selection from R100 to R500 via R1>R2>R3>R4…
There are 2 solution by influencing outbound traffic
  1. Using weight attribute. Highest weight will be preferred
  2. Using local preference. Highest local preference will be preferred
Let’s use weight first

R1#
router bgp 12
   neighbor 12.12.12.2 route-map WEIGHT_IN in

route-map WEIGHT_IN permit 10
  set weight 100

Now let’s check best path in R1 to R500 and trace route to make sure that the traffic to R500 via R1>R2>R3>R4

If the BGP routing table is not change, please do not be panic J Clear ip bgp first to get new change BGP best path

R1(config-route-map)#do clear ip bgp *

R1(config-route-map)#do sh ip bgp 50.50.50.50
BGP routing table entry for 50.50.50.50/32, version 7
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Flag: 0x820
  Advertised to update-groups:
        1
  34 500
    14.14.14.4 from 14.14.14.4 (4.4.4.4)
      Origin IGP, localpref 100, valid, external
  34 500
    12.12.12.2 from 12.12.12.2 (2.2.2.2)
      Origin IGP, metric 0, localpref 100, weight 100, valid, internal, best  ---- > already change the best path

R100(config-router)#do tracer 50.50.50.50 sour 10.10.10.10
Type escape sequence to abort.
Tracing the route to 50.50.50.50

  1 110.110.110.1 32 msec 8 msec 32 msec
  2 12.12.12.2 168 msec 44 msec 92 msec
  3 23.23.23.3 140 msec 120 msec 84 msec
  4 34.34.34.4 104 msec 92 msec 104 msec
  5 150.150.150.50 112 msec *  152 msec

Holysh##! You make my day BGP J

2 comments:

  1. Hey Fauzi I am Josinfo from Brazil, and I meet your blog one week ago, and i can tell that you are doing a great job thanks a lot to share your skills with us !

    see you
    att,
    Josinfo

    ReplyDelete
  2. Bwire From Kenya Fantastic stuff

    ReplyDelete