用ROUTE-MAP實現負載均衡

 
R1:int lo 0

ip add 1.1.1.1 255.255.255.0

no shut

exit

int lo 1

ip add 88.88.88.88 255.255.255.0

no shut

exit

int s1/1

ip add 172.16.12.1 255.255.255.0

no shut

exit

router ospf 100

log-adjacency-changes

network 1.1.1.1 0.0.0.0 area 1

network 88.88.88.88 0.0.0.0 area 1

network 172.16.12.1 0.0.0.0 area 1

R2:int f0/0

no sw

ip add 192.168.25.2 255.255.255.0

no shut

exit

int s1/0

ip add 172.16.12.2 255.255.255.0

no shut

exit

int s1/1

ip add 192.168.23.2 255.255.255.0

no shut

exit

router ospf 100

log-adjacency-changes

network 172.16.12.2 0.0.0.0 area 1

network 192.168.25.2 0.0.0.0 area 0

network 192.168.23.2 0.0.0.0 area 0

R3:int s1/0

ip add 192.168.23.3 255.255.255.0

no shut

exit

int s1/1

ip add 192.168.34.3 255.255.255.0

no shut

exit

router ospf 100

log-adjacency-changes

network 192.168.23.3 0.0.0.0 area 0

network 192.168.34.3 0.0.0.0 area 2

R4:int lo 0

ip add 4.4.4.4 255.255.255.0

no shut

exit

int s1/0

ip add 192.168.34.4 255.255.255.0

no shut

exit

int s1/2

ip add 192.168.45.4 255.255.255.0

no shut

exit

router ospf 100

log-adjacency-changes

network 4.4.4.4 0.0.0.0 area 2

network 192.168.34.4 0.0.0.0 area 2

network 192.168.45.4 0.0.0.0 area 2

R5:int s1/3

ip add 192.168.45.5 255.255.255.0

no shut

exit

int f0/0

no sw

ip add 192.168.25.5 255.255.255.0

no shut

exit

router ospf 100

log-adjacency-changes

network 192.168.45.5 0.0.0.0 area 2

network 192.168.25.5 0.0.0.0 area 0
 
本案例沒做路由策略前路由器根據計算最佳路徑區域1的流量全部走R1-R2-R5-R4

 

在R2配置ROUTE-MAP

access-list 1 permit 1.1.1.0 0.0.0.255
route-map 12
match ip add 1
match int s1/1
set int s1/1
exit
int s1/0
ip policy route-map 12
做了路由策略後1.1.1.0走R1--R2--R3--R4,88.88.88.0走R1--R2--R5--R4這樣便可實現負載均衡和鏈路的備份。
測試結果可以用:
show ip route
show ip ospf neighbor
show ip ospf inter 接口
show ip ospf database
traceroute
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章