Skip to main content

BGP Weight Lab 1

At BGP best path selection algorithm the weight attribute is first.
The default weight for learned routes is 0 and the default weight for a locally originated route is 32768. Weight attribute is preferred large number weight. Only effect on outgoing traffic.
 

Figure 1.1

In this scenario by default R1 will choose AS200 to reach AS500. We want to use AS300 path to reach to AS500. So let play with weight. We have  two options using to Weight
  1. Set the weight attribute on the neighbor (That will affect all routes learn from that neighbor)
  2. Using Route map can specific routes to have the weight set.
Configuration

Weight attribute on neighbor

R1
router bgp 140
 no synchronization
 bgp log-neighbor-changes
 network 1.1.1.0 mask 255.255.255.0
 neighbor 10.1.12.2 remote-as 200
 neighbor 10.1.14.4 remote-as 140
 neighbor 10.1.14.4 next-hop-self
 neighbor 10.1.14.4 weight 100
 no auto-summary

R2
 router bgp 200
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.1.12.1 remote-as 140
 neighbor 10.1.25.5 remote-as 500
 no auto-summary

R3
router bgp 300
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.1.34.4 remote-as 140
 neighbor 10.1.35.5 remote-as 500
 no auto-summary


R4
router bgp 140
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.1.14.1 remote-as 140
 neighbor 10.1.14.1 next-hop-self
 neighbor 10.1.34.3 remote-as 300
 no auto-summary

R5
router bgp 500
 no synchronization
 bgp log-neighbor-changes
 network 5.5.5.0 mask 255.255.255.0
 neighbor 10.1.25.2 remote-as 200
 neighbor 10.1.35.3 remote-as 300
 no auto-summary

Verification

R1
Before
R1#sh ip bgp
BGP table version is 3, local router ID is 1.1.1.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
*> 1.1.1.0/24       0.0.0.0                  0                32768   i
* i5.5.5.0/24       10.1.14.4                0     100       0         300 500 i
*>                  10.1.12.2                                      0         200 500 i


After

R1#sh ip bgp
BGP table version is 7, local router ID is 1.1.1.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
*> 1.1.1.0/24       0.0.0.0                  0                  32768    i
*>i5.5.5.0/24       10.1.14.4               0    100        100        300 500 i
*                         10.1.12.2                                  0           200 500 i


R1#trace 5.5.5.5 source 1.1.1.1
Type escape sequence to abort.
Tracing the route to 5.5.5.5
  1 10.1.14.4 12 msec 52 msec 12 msec
  2 10.1.34.3 12 msec 24 msec 20 msec
  3 10.1.35.5 44 msec 20 msec 24 msec

R5#trace 1.1.1.1 so lo0
Type escape sequence to abort.
Tracing the route to 1.1.1.1
  1 10.1.25.2 8 msec 8 msec 12 msec
  2 10.1.12.1 32 msec 24 msec 44 msec

BGP weight attribute is not share to neighbor.

R4#sh ip bgp
BGP table version is 10, local router ID is 10.1.34.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
*>i1.1.1.0/24       10.1.14.1                0    100      0         i
*> 5.5.5.0/24       10.1.34.3                                 0         300 500 i

Weight attribute with Route map

Let add the network 55.55.55.0/24 network at R5. So we can compare 5.5.5.0/24 network and 55.55.55.0/24 network.

First remove the previous configure.

Configuration

R1
router bgp 140
 no neighbor 10.1.14.4 weight 100

Clear ip bgp *
Be careful this command effect all routes.

access-list 1 permit 5.5.5.0 0.0.0.255

route-map R5_Weight permit 10
 match ip address 1
 set weight 200

router bgp 140
neighbor 10.1.14.4 route-map R5_Weight in

Verification

R1#sh ip bgp
BGP table version is 4, local router ID is 1.1.1.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
*> 1.1.1.0/24       0.0.0.0                  0                32768  i
*  5.5.5.0/24       10.1.12.2                                  0        200 500 i
*>i                 10.1.14.4                0    100          200     300 500 i

*> 55.55.55.0/24    10.1.12.2                              0        200 500 i

R1#traceroute 5.5.5.5 source 1.1.1.1
Type escape sequence to abort.
Tracing the route to 5.5.5.5
  1 10.1.14.4 16 msec 36 msec 44 msec
  2 10.1.34.3 20 msec 24 msec 20 msec
  3 10.1.35.5 44 msec 24 msec 44 msec

R1#traceroute 55.55.55.55 source 1.1.1.1
Type escape sequence to abort.
Tracing the route to 55.55.55.55
  1 10.1.12.2 12 msec 32 msec 44 msec
  2 10.1.25.5 88 msec 64 msec 24 msec

Comments

Popular posts from this blog

How to setup AWS VPC Peering (VPC to VPC)

    Hi Everyone... ဒီကနေ့တော့ VPC Peering လုပ်တဲ့ အကြောင်းလေးပြောပြပေးသွားမှာပါ။ VPC peering ဘာလို့လုပ်တာလဲ ဘယ်အချိန်တွေမှာသုံးတာလဲဆိုတာကို ကြည့်ရအောင်... သိတဲ့ အတိုင်း ပဲ AWS networking မှာ VPC ကမပါမဖြစ်အရေးပါပါတယ် AWS account တခုရဲ့ AWS region တခုမှာ VPC 5ခုအများဆုံး ထားလို့ရပါတယ်... AZ မဟုတ်ပါဘူး အဲ့ဒါလေးတော့သတိထားရမှာပါ.. peering က one to one ဖြစ်တဲ့အတွက် VPC များလာရင်တော့ configuation complex ဖြစ်လာပါမယ်၊ နောက်တခုကတခြား AWS account တွေရဲ့ VPC နဲ့ချိတ်ဆက်သုံးချင်တာတွေလဲရှိနိုင်ပါတယ် အဲ့လို VPC တွေများလာမယ်ဆိုရင်တော့ Transit Gateway ကိုသုံးတာက ပိုစိတ်ချမ်းသာရပါတယ်။ VPC နည်းသေးတယ် နောင်လဲတိုးလာဖို့ မရှိသေးဘူးဆိုရင်တော့ အခုနည်းလမ်းက ပိုအဆင်ပြေပါတယ်. ဆိုတော့ Pubilc VPC နဲ့ Private VPC ဆိုပြီးရှိတယ်ဆိုပါစို့ Pubilc VPC ထဲက webserver က Private VPC ထဲ က database ကိုလှမ်းသုံးချင်တယ်ဆိုရင် အဲ့ဒီ VPC တွေကို peering လုပ်ပေးဖို့လိုပါတယ်.. Peering လုပ်မယ်ဆိုရင်တော့ VPC ထဲက peering connections ကိုရွေးရပါမယ်. ပြီးရင်တော့ Create peering connections ကို click ပါ၊ ဒီ box ကျလာရင်တော့ ...

Nested Route Reflection Cluster

Figure 1.1 R1 router bgp 65000  bgp cluster-id 10  neighbor 2.2.2.2 remote-as 65000  neighbor 2.2.2.2 update-source Loopback0  neighbor 2.2.2.2 route-reflector-client  neighbor 3.3.3.3 remote-as 65000  neighbor 3.3.3.3 update-source Loopback0  neighbor 3.3.3.3 route-reflector-client R2 router bgp 65000  bgp cluster-id 20  net 22.22.22.0 mask 255.255.255.0  neighbor 1.1.1.1 remote-as 65000  neighbor 1.1.1.1 update-source Loopback0  neighbor 4.4.4.4 remote-as 65000  neighbor 4.4.4.4 update-source Loopback0  neighbor 4.4.4.4 route-reflector-client R3 router bgp 65000  bgp cluster-id 30  net 33.33.33.0 mask 255.255.255.0  neighbor 1.1.1.1 remote-as 65000  neighbor 1.1.1.1 update-source Loopback0  neighbor 5.5.5.5 remote-as 65000  neighbor 5.5.5.5 update-source Loopback0  neighbor 5.5.5.5 route-reflector-client R4 router bgp 65000 ...

VPN with GRE Tunnel

Configure https://drive.google.com/open?id=0B-Y7rSPpDdRCemRyNi05eGdXMmc