Search This Blog

Monday 14 November 2011

How to configure BGP Attribute Weight on Cisco routers?

How to configure BGP Attribute Weight on Cisco routers?

Routes learned via BGP have associated properties that are used to determine the best route to a destination when multiple paths exist to a particular destination. These properties are referred to as BGP attributes, and an understanding of how BGP
attributes influence route selection is required for the design of robust networks. This section describes the attributes that BGP uses in the route selection process:

Weight
Local preference
Multi-exit discriminator
Origin
AS path
Next hop
Community


Weight Attribute

Weight is a Cisco-defined attribute that is local to a router. The weight attribute is not advertised to neighboring routers. If the router learns about more than one route to the same destination, the route with the highest weight will be preferred.
The route with the highest weight will be installed in the IP routing table.

RUNNING RIP ON ROUTER-A

A(config)# router rip
A(config-router)# network 200.100.50.0
A(config-router)# network 1.0.0.0


RUNNING EBGP ON ROUTER-A

A(config)# router  bgp 10
A(config-router)# no synchronization
A(config-router)# neighbor 1.1.1.2 remote-as 20
A(config-router)# neighbor 4.1.1.1 remote-as 20
A(config-router)# network200.100.50.0


RUNNING EBGP ON ROUTER-B

B(config)# router bgp 20
B(config-router)# no synchronization
B(config-router)# neighbor 1.1.1.1remote-as 10

RUNNING EBGP ON ROUTER-D

D(config)# router bgp 20
D(config-router)# no synchronization
D(config-router)# neighbor 4.1.1.2 remote-as 10

RUNNING OSPF ON ROUTER-B

B(config)# router ospf 1
B(config-router)# network 2.0.0.0 0.255.255.255  area 0
B(config-router)# network 1.0.0.0 0.255.255.255  area 0


RUNNING OSPF ON ROUTER-C

C(config)# router ospf 1
C(config-router)# network 2.0.0.0 0.255.255.255 area 0
C(config-router)# network 3.0.0.0 0.255.255.255 area 0

RUNNING OSPF ON ROUTER-D

D(config)# router ospf 1
D(config-router)# network 3.0.0.0 0.255.255.255 area 0
D(config-router)# network 4.0.0.0 0.255.255.255 area 0

RUNNING IBGP ON ROUTER-B

B(config)# router bgp 20
B(config-router)# no synchronization
B(config-router)# neighbor 4.1.1.1remote-as 20
B(config-router)# neighbor 2.1.1.2remote-as 20

RUNNING IBGP ON ROUTER-C
C(config)# router bgp 20
C(config-router)# no synchronization
C(config-router)# neighbor 2.1.1.1remote-as 20
C(config-router)# neighbor 3.1.1.2remote-as 20

RUNNING IBGP ON ROUTER-D

D(config)# router bgp 20
D(config-router)# no synchronization
D(config-router)# neighbor 3.1.1.1remote-as 20
D(config-router)# neighbor 2.1.1.1remote-as 20


CHANGING WEIGHT ATTRIBUTE OF SERIAL 1/0 - ROUTER-C?

C(config)# router bgp 20
C(config-router)# neighbor 3.1.1.2 weight 333
C# clear ip bgp *


CHANGING WEIGHT ATTRIBUTE OF SERIAL 1/1 OF ROUTER-C

C(config)# router bgp 20
C(config-router)# neighbor 2.1.1.1 weight 333
C# clear ip bgp *


Here, we have configured same value of weight attribute at both interfaces of Router-C. In this case, decision would take place using Router-ID attribute. Router having smaller value of Router-ID shall be preferred. Here Router-ID of Router-D is 200.100.200.1 and Router-ID of Router-B is 200.100.100.1. Therefore, Router-B has been preferred. You can check Router-ID of a neighbor by using following command:

C# show ip bgp neighbor

No comments:

Post a Comment