ospf路徑選擇實驗

ospf路徑選擇實驗

相關知識:

cost值=各路由 (10^8)/BW相加

show interface *(e1/0) 可以查看BW等值

show ip ospf interface *(e1/0) 查看該接口的cost值

修改帶寬(DW),修改分子(默認位10^8),直接修
改接口的cost。,達到負載均衡,決定路徑走向。

修改方法:

帶寬修改:
enable
conf t
interface *(e0)
bandwidth *(帶寬值)

分子修改
enable
conf t
router ospf 100
auto-cost reference-bandwidth 1000
100M=10^8,1000既修改爲10^9,而且修
改一個路由,所有路由都要修改

cost口修改
enable
conf t
interface *(e0)
ip ospf cost *(值)


實驗平臺:思科官方PT5.0或DY模擬器
 
 
 
 
基本配置:
enable
conf t
no ip domain-lookup
exec-timeout 0 0
logging synch
exit
hostname

R2配置:
enable
conf t
interface S0/0
no shutdown
ip address 12.0.0.2 255.255.255.0
clock rate 64000
interface S0/1
no shutdown
ip address 24.0.0.2 255.255.255.0
clock rate 64000
exit
router ospf 100
network 12.0.0.0 0.0.0.255 area 0
network 24.0.0.0 0.0.0.255 area 0

R1配置:
enable
conf t
interface S0/0
no shutdown
ip address 12.0.0.1 255.255.255.0
clock rate 64000
interface S0/1
no shutdown
ip address 13.0.0.1 255.255.255.0
clock rate 64000
exit
router ospf 100
network 12.0.0.0 0.0.0.255 area 0
network 13.0.0.0 0.0.0.255 area 0

R3配置:
enable
conf t
interface S0/0
no shutdown
ip address 13.0.0.3 255.255.255.0
clock rate 64000
interface S0/1
no shutdown
ip address 35.0.0.3 255.255.255.0
clock rate 64000
exit
router ospf 100
network 13.0.0.0 0.0.0.255 area 0
network 35.0.0.0 0.0.0.255 area 0

R4配置:
enable
conf t
interface S0/0
no shutdown
ip address 24.0.0.4 255.255.255.0
clock rate 64000
interface e1/0
no shutdown
ip address 45.0.0.4 255.255.255.0

exit
router ospf 100
network 24.0.0.0 0.0.0.255 area 0
network 45.0.0.0 0.0.0.255 area 0

R5配置:
enable
conf t
interface S0/0
no shutdown
ip address 35.0.0.5 255.255.255.0
clock rate 64000
interface e1/0
no shutdown
ip address 45.0.0.5 255.255.255.0
interface loopback 0
ip address 5.5.5.5 255.255.255.255
no shutdown
exit
router ospf 100
network 13.0.0.0 0.0.0.255 area 0
network 35.0.0.0 0.0.0.255 area 0
network 5.5.5.5 0.0.0.0 area 0

以R2到R5的lookback0爲例,有兩條路徑,各路由cost值和小的爲R2選擇的路徑,所以要改變ospf的路徑,就要修改數據使cost值變化決定路徑走向

以直接修改cost值選路徑爲例:

cost值=各路由 (10^8)/BW相加

R2/R4/R5路由
s0/1* MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
e1/0* MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,
loo0* MTU 1514 bytes, BW 8000000 Kbit, DLY 5000 usec,
10^8/(1544*1000)=64.77
10^8/(10000*1000)=10
10^8/(8000000*1000)=0.0125
C=64.77+10+0.0.125≈75

R2/R1/R3/R5路由
s0/0 &  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
s0/1 &  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
s0/1 &  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
loo0 & MTU 1514 bytes, BW 8000000 Kbit, DLY 5000 usec,
C=64.77+64.77+64.77+0.125≈194.3  系統R2到R5選下路徑cost值爲193,知道計算就OK
 
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章