SOURCECODEBD.NET

Live Experience

8.  LOCAL PREFERENCE

HOW TO LOCAL PREFERENCE CONFIGURATION
 
Interface IP Address Configuration 
 
R1 
 
Interface  IP Address   Subnet Mask 
S 0     1.1.1.1   255.0.0.0 
S 1     3.3.3.1   255.0.0.0 
E 0     10.1.1.1   255.0.0.0 
 
R2 
 
Interface  IP Address   Subnet Mask 
S 0     1.1.1.2   255.0.0.0 
S 1     2.2.2.1   255.0.0.0 
E 0     20.1.1.1   255.0.0.0 
  
R3 
 
Interface  IP Address   Subnet Mask 
S 0     2.2.2.2   255.0.0.0 
S 1     3.3.3.2   255.0.0.0 
E 0     30.1.1.1   255.0.0.0 
 
Task 1: 
 
Configure AS 100 such that all traffic destined for AS 200 should go through R2. Use 
Local-Preference Attribute to accomplish this task. 
 
R1 
 
Router bgp 100 
Neighbor 1.1.1.2 remote-as 200 
Neighbor 3.3.3.2 remote-as 100 
Network 1.0.0.0 
Network 3.0.0.0 
Network 10.0.0.0 
No synchronization 
 
R2 
 
Router bgp 200 
Neighbor 1.1.1.1 remote-as 100 
Neighbor 2.2.2.2 remote-as 100 
Network 1.0.0.0 
Network 2.0.0.0 
Network 20.0.0.0 
No synchronization
 
R3 
 
Router bgp 100 
Neighbor 2.2.2.1 remote-as 200 
Neighbor 3.3.3.1 remote-as 100 
Bgp default-preference 500 
Network 2.0.0.0 
Network 3.0.0.0 
Network 30.0.0.0 
No synchronization 
 
Verification: 
 
R3#show ip route
 
The output displays that R3 learns network 1.0.0.0 via 2.2.2.1. 
 
R3#show ip bgp 1.0.0.0 
 
The output displays that path 2.2.2.1 is the best path, because of the highest local 
preference value over the other path. 
 
 
Task 2
 
Configure route-map using local-preference attribute to manipulate the routing 
information on R3. 
 
R3 
 
Access-list 1 permit 20.0.0.0 0.255.255.255 
 
Route-map list 1 permit 10 
Match ip address 1 
Set local preference 50 
 
Route-map list 1 permit 20 
 
Router bgp 200 
Neighbor 2.2.2.1 remote-as 200 
Neighbor 2.2.2.1 route-map list1 in 
Neighbor 3.3.3.1 remote-as 100 
Network 3.0.0.0 
Network 2.0.0.0 
Network 30.0.0.0 
No synchronization 
 
Verification: 
 
R3#show ip route 
 
R3#show ip bgp 20.0.0.0
 
The output displays that path 1.1.1.2 is the best path, because of the highest local 
preference value over the other path.
You are here: Home / BGP / HOW TO LOCAL PREFERENCE CONFIGURATION