Basic configurations are at the bottom
Without any path controls, the routes for 150.1.50.0/24 and 150.2.50.0/24 networks are going through R2 from R1, and the routes for 200.50.2.0/24 and 200.60.2.0/24 networks are going through R3 from R1.
Path control 1 : Weight
Q1> Change the routes of all networks going through R3.
conf t
router bgp 5500
neighbor 10.1.13.3 weight 1000 (greater than 0)
end
clear ip bgp *
Path control 2 : Origin
Q2> Remove the weight configuration.
Origin: At the end of routes, there is "?" or "i". question mark means the route is redistributed.
"i" means the route is used by the command of "network xxxx mask xxxx"
By default, route "i" is preferred.
Path control 3 : Local Preference.
remove weight configuration.
Q1> Use Local Preference on R3 to change all the routes to R3.
R3:
conf t
router bgp 5500
bgp default local-preference 1000(higher is better)
end
clear ip bgp *
Q2> From R1, 150 networks should go through R3, and 200 networks should go through R2.
(remove bgp default local-preference 1000 on R3)
R3:
ip access-list standard ROUTE-TO-150
permit 150.1.50.0 0.0.0.255
permit 150.2.50.0 0.0.0.255
ip access-list standard ROUTE-TO-200
permit 200.50.2.1 0.0.0.255
permit 200.60.2.1 0.0.0.255
route-map LOCAL_PREF permit 10
match ip address ROUTE-TO-150
set local-preference 1000
exit
route-map LOCAL_PREF permit 20
match ip address ROUTE-TO-200
set local-preference 50
exit
route-map LOCAL_PREF permit 30 (if doesn't match any access-list, go basic preference.)
router bgp 5500
neighbor 6.6.6.6 route-map LOCAL_PREF in
Path control 3 : Metric ( This is the only one that can affect something to other AS to choose preferred route.)
First, establish neighbor relationship between R4 and R6.
R4 configuration
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface Serial0/0
ip address 10.1.46.4 255.255.255.0
clock rate 2000000
!
interface Serial0/2
ip address 10.1.24.4 255.255.255.0
clock rate 2000000
!
interface Serial0/5
ip address 10.1.45.4 255.255.255.0
clock rate 2000000
!
router bgp 777
no synchronization
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 5500
neighbor 2.2.2.2 ebgp-multihop 2
neighbor 2.2.2.2 update-source Loopback0
neighbor 5.5.5.5 remote-as 911
neighbor 5.5.5.5 ebgp-multihop 2
neighbor 5.5.5.5 update-source Loopback0
neighbor 10.1.46.6 remote-as 777
neighbor 10.1.46.6 next-hop-self
no auto-summary
!
ip forward-protocol nd
ip route 2.2.2.2 255.255.255.255 10.1.24.2
ip route 5.5.5.5 255.255.255.255 10.1.45.5
R6 configuration
interface Loopback0
ip address 6.6.6.6 255.255.255.255
!
interface Serial0/0
ip address 10.1.46.6 255.255.255.0
clock rate 2000000
!
interface Serial0/3
ip address 10.1.36.6 255.255.255.0
clock rate 2000000
!
interface Serial0/5
ip address 10.1.67.6 255.255.255.0
clock rate 2000000
!
router bgp 777
no synchronization
bgp log-neighbor-changes
neighbor 3.3.3.3 remote-as 5500
neighbor 3.3.3.3 ebgp-multihop 2
neighbor 3.3.3.3 update-source Loopback0
neighbor 7.7.7.7 remote-as 711
neighbor 7.7.7.7 ebgp-multihop 2
neighbor 7.7.7.7 update-source Loopback0
neighbor 10.1.46.4 remote-as 777
neighbor 10.1.46.4 next-hop-self
no auto-summary
!
ip forward-protocol nd
ip route 3.3.3.3 255.255.255.255 10.1.36.3
ip route 7.7.7.7 255.255.255.255 10.1.67.7
Q1> Change the all the routes on R1 to go through R2. (Use metric)
R3>
router bgp 5500
defalt-metric 200
or
route-map METRIC
set metric 200
router bgp 5500
default-metric route-map METRIC
===============================================
R1>
interface Loopback0ip address 1.1.1.1 255.255.255.255
!
interface Serial0/2
ip address 10.1.12.1 255.255.255.0
clock rate 2000000
!
interface Serial0/3
ip address 10.1.13.1 255.255.255.0
clock rate 2000000
!
router bgp 5500
no synchronization
bgp log-neighbor-changes
neighbor 10.1.12.2 remote-as 5500
neighbor 10.1.13.3 remote-as 5500
no auto-summary
!
R2>
interface Loopback0ip address 2.2.2.2 255.255.255.255
!
interface Serial0/3
ip address 10.1.23.2 255.255.255.0
clock rate 2000000
!
interface Serial0/4
ip address 10.1.24.2 255.255.255.0
clock rate 2000000
!
router bgp 5500
no synchronization
bgp log-neighbor-changes
neighbor 4.4.4.4 remote-as 777
neighbor 4.4.4.4 ebgp-multihop 2
neighbor 4.4.4.4 update-source Loopback0
neighbor 10.1.12.1 remote-as 5500
neighbor 10.1.12.1 next-hop-self
neighbor 10.1.23.3 remote-as 5500
no auto-summary
!
ip forward-protocol nd
ip route 4.4.4.4 255.255.255.255 10.1.24.4
R3>
interface Loopback0ip address 3.3.3.3 255.255.255.255
!
interface Serial0/1
ip address 10.1.13.3 255.255.255.0
clock rate 2000000
!
interface Serial0/2
ip address 10.1.23.3 255.255.255.0
clock rate 2000000
!
interface Serial0/5
ip address 10.1.36.3 255.255.255.0
clock rate 2000000
!
router bgp 5500
no synchronization
bgp log-neighbor-changes
neighbor 6.6.6.6 remote-as 777
neighbor 6.6.6.6 ebgp-multihop 2
neighbor 6.6.6.6 update-source Loopback0
neighbor 10.1.13.1 remote-as 5500
neighbor 10.1.13.1 next-hop-self
neighbor 10.1.23.2 remote-as 5500
no auto-summary
!
ip forward-protocol nd
ip route 6.6.6.6 255.255.255.255 10.1.36.6
!
R4>
interface Loopback0ip address 4.4.4.4 255.255.255.255
!
interface Serial0/2
ip address 10.1.24.4 255.255.255.0
clock rate 2000000
!
interface Serial0/5
ip address 10.1.45.4 255.255.255.0
clock rate 2000000
!
router bgp 777
no synchronization
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 5500
neighbor 2.2.2.2 ebgp-multihop 2
neighbor 2.2.2.2 update-source Loopback0
neighbor 5.5.5.5 remote-as 911
neighbor 5.5.5.5 ebgp-multihop 2
neighbor 5.5.5.5 update-source Loopback0
no auto-summary
!
ip forward-protocol nd
ip route 2.2.2.2 255.255.255.255 10.1.24.2
ip route 5.5.5.5 255.255.255.255 10.1.45.5
R5>
interface Loopback0ip address 5.5.5.5 255.255.255.255
!
interface Loopback10
ip address 150.1.50.1 255.255.255.0
!
interface Loopback11
ip address 150.2.50.1 255.255.255.0
!
interface Serial0/4
ip address 10.1.45.5 255.255.255.0
clock rate 2000000
!
interface Serial0/5
ip address 10.1.57.5 255.255.255.0
clock rate 2000000
!
router bgp 911
no synchronization
bgp log-neighbor-changes
redistribute connected route-map Filter
neighbor 4.4.4.4 remote-as 777
neighbor 4.4.4.4 ebgp-multihop 2
neighbor 4.4.4.4 update-source Loopback0
neighbor 7.7.7.7 remote-as 711
neighbor 7.7.7.7 ebgp-multihop 2
neighbor 7.7.7.7 update-source Loopback0
no auto-summary
!
ip forward-protocol nd
ip route 4.4.4.4 255.255.255.255 10.1.45.4
ip route 7.7.7.7 255.255.255.255 10.1.57.7
!
access-list 1 permit 150.1.50.0 0.0.0.255
access-list 1 permit 150.2.50.0 0.0.0.255
!
route-map Filter permit 10
match ip address 1
R6>
interface Loopback0ip address 6.6.6.6 255.255.255.255
!
interface Serial0/3
ip address 10.1.36.6 255.255.255.0
clock rate 2000000
!
interface Serial0/5
ip address 10.1.67.6 255.255.255.0
clock rate 2000000
!
router bgp 777
no synchronization
bgp log-neighbor-changes
neighbor 3.3.3.3 remote-as 5500
neighbor 3.3.3.3 ebgp-multihop 2
neighbor 3.3.3.3 update-source Loopback0
neighbor 7.7.7.7 remote-as 711
neighbor 7.7.7.7 ebgp-multihop 2
neighbor 7.7.7.7 update-source Loopback0
no auto-summary
!
ip forward-protocol nd
ip route 3.3.3.3 255.255.255.255 10.1.36.3
ip route 7.7.7.7 255.255.255.255 10.1.67.7
R7>
interface Loopback0
ip address 7.7.7.7 255.255.255.255
!
interface Loopback10
ip address 200.50.2.1 255.255.255.0
!
interface Loopback11
ip address 200.60.2.1 255.255.255.0
!
interface Serial0/4
ip address 10.1.57.7 255.255.255.0
clock rate 2000000
!
interface Serial0/5
ip address 10.1.67.7 255.255.255.0
clock rate 2000000
!
router bgp 711
no synchronization
bgp log-neighbor-changes
network 200.50.2.0
network 200.60.2.0
neighbor 5.5.5.5 remote-as 911
neighbor 5.5.5.5 ebgp-multihop 2
neighbor 5.5.5.5 update-source Loopback0
neighbor 6.6.6.6 remote-as 777
neighbor 6.6.6.6 ebgp-multihop 2
neighbor 6.6.6.6 update-source Loopback0
no auto-summary
!
ip forward-protocol nd
ip route 5.5.5.5 255.255.255.255 10.1.57.5
ip route 6.6.6.6 255.255.255.255 10.1.67.6
No comments:
Post a Comment