OSPF基本框架:
路由选择-metric值的计算
沿路入向接口cost值累加
接口cost值=10^8/接口带宽
如何修改OSPF的接口cost值?
max-metric.
O的路由的metric值=通过LSA-1/LSA-2计算
OIA的路由metric值=通过LSA-1/LSA-2计算到ABR的距离+LSA-3(ABR去往这条路由的距离)
OE1路由的metric值=通过LSA-1/LSA-2/LSA-3或LSA-4计算去往ASBR的距离+seed-metric
OE2路由的metric值=seed-metric
沿路入向接口cost值累加
接口cost值等于十的八次方除接口带宽
如何修改ospf的接口cost值
1.改带宽
#int e0/0
IOU1(config-if)#bandwidth 1000
2.改参考带宽,默认是100m(如果要改,建议在ospf区域内设备都改)
)#router ospf 1
IOU1(config-router)#auto-cost reference-bandwidth 5000 (修改为5gb)
3.直接修改
#int e0/0
IOU1(config-if)#ip ospf cost 10
一个接口cost值的最大是65535
这台设备产生的一类LSA所有的接口cost值都为65535
IOU1(config)#router ospf 1
IOU1(config-router)#max-metric router-lsa
会将所有LSA-1中的transit和point-to-point设置为65535,这样尽量会使流量bypass
三类LSA的接口cost改为65535
IOU1(config-router)#max-metric router-lsa summary-lsa
以此类推
R1 (config-router) # max-metric router-lsa on-startup 3600 (启动3600秒之后将65535换成默认的值)
R1 (config-router) # max-metric router-lsa on-startup wait-for-bgp(等BGP收敛完毕以后改为默认值)
可以用于割接,或RR设备上
O> OIA > OE1 > OE2
当OE2的metric值相同的时候,比较forward-metricForward-metric是本路由器去往ASBR的forwardaddress的距离
相同的metric值,不看路由,只看类型
O的路由的别名: :intra-area
OIA的路由的别名:inter-area
OE1 & OE2的别名: external
ON1 & ON2的别名: nssa-external