BGP Weight Attribute

Goal :

- Manipulate outbound traffic from R1 to network 3.3.3.0/24 goes through R2>R4>R3. Normal BGP routing table should goes through R3 directly.

- Make sure outbound traffic from R1 to network 44.44.44.0/24 will always goes through R3>R4

 

Configuration :

Create route-map for match ip access-list & set weight attribute.

R1#

route-map toR2 permit 10

 match ip address 1

 set weight 500

 exit

route-map toR2 permit 20

 exit

route-map toR3 permit 10

 match ip address 2

 set weight 65535

 exit

route-map toR3 permit 20

 exit

 

Create access-list

R1#

access-list 1 permit 3.3.3.0 0.0.0.255

access-list 2 permit 44.44.44.0

 

BGP router configuration

R1#

router bgp 12

 no synchronization

 bgp log-neighbor-changes

 network 1.1.1.0 mask 255.255.255.0

 network 11.11.11.0 mask 255.255.255.0

 network 192.168.12.0

 network 192.168.13.0

 neighbor 192.168.12.2 remote-as 12

 neighbor 192.168.12.2 route-map toR2 in

 neighbor 192.168.13.3 remote-as 34

 neighbor 192.168.13.3 route-map toR3 in

 no auto-summary

 

Verification :

R1# sh ip bgp

*>i3.3.3.0/24       192.168.24.4             0    100    500 34 i -> Weight 500

*                   192.168.13.3             0             0 34 i

* i44.44.44.0/24    192.168.24.4             0    100      0 34 i

 *>                  192.168.13.3                       65535 34 i  -> Highest weight 65535