靜态路由:static
隻有在點到點的情況下下一跳才可以寫出接口 s0/0/0
去包路由
R1
[ ] ip route-static 192.168.2.0 24 12.1.1.2
目标網段 下一跳地址
[ ] ip route-static 23.1.1.0 24 12.1.1.2
R2
[ ] ip route-static 192.168.2.0 24 23.1.1.2
回包路由
R3
[R3]ip route-static 192.168.1.0 24 23.1.1.1
[R3]ip route-static 12.1.1.0 24 23.1.1.1
R2
R2]ip route-static 192.168.1.0 24 12.1.1.1
注意:靜态路由 目标IP地址永遠不變
在路由器上進行ping 包,默認情況下,報文的源地址是自己的出接口地址。
缺省路由
常用查看命令
Dis cu 查看所有配置
Dis IP int brief 查看接口配置信息
Dis IP routing-table 查看路由表
環回接口:loopback接口
模拟網段,實驗情況下模拟服務器
R1
[R1]ip route-static 0.0.0.0 0 12.1.1.2(下一跳地址為運營商)
注意:缺省路由是“替補”路由,隻有當其他路由都不可達時,才會使用缺省路由。缺省路由适合用于邊緣路由器。
R2
[R2]ip route-static 192.168.5.0 24 12.1.1.1
路由器優先級
路由器優先級:prefernce,代表路由器的優先程度,當多個路由協議的路由都可到達某個目标網段時,此時路由器會優先選擇數字較小的路由(數字越小越優先)
内部優先級 外部優先級
内部優先級固定不可修改
外部優先級可以修改
常用路由協議的默認優先級
直連路由 :direct 0 最優先
靜态路由:static 60
Rip 100
Ospf 10
注:優先級的範圍1—255
R1
R1]ip route-static 172.16.1.0 24 21.1.1.2
[R1]ip route-static 172.16.1.0 24 12.1.1.2 preference 65 (優先級設置為65)
R2
[R2]ip route-static 192.168.1.0 24 12.1.1.1 pr
[R2]ip route-static 192.168.1.0 24 12.1.1.1 preference 65
tracert 172.16.1.2 (路由選路)
Shutdown g 0/0/0
路由開銷:(路由開銷cost)
對于同一個路由協議,當到達某個目标網段有多條路由供選擇時,此時路由器會優先選擇cost值較小的鍊路。
注意:先比較油路優先級,再比較路由度量。隻有當路由優先級相同時,才會使用路由度量。路由表中始終會放置最優的路由。
企業雙出口冗餘
R1
[R1]ip route-static 0.0.0.0 0 13.1.1.2 preference 65 (增大優先級數值)
[R1]ip route-static 0.0.0.0 0 12.1.1.2
R2
[R2]ip route-static 192.168.5.0 24 12.1.1.1
R3
[R3]ip route-static 192.168.5.0 24 13.1.1.1
,更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!