华为静态,默认,浮动路由
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了华为静态,默认,浮动路由相关的知识,希望对你有一定的参考价值。
实验1:使用静态路由让AR1到AR4可以通信,指定到达某一个网段和通过的下一跳接口
[AR1]ip route-static 23.0.0.0 255.255.255.0 12.0.0.2
[AR1]ip route-static 34.0.0.0 255.255.255.0 12.0.0.2
[AR1]ip route-static 2.2.2.2 255.255.255.255 12.0.0.2
[AR1]ip route-static 3.3.3.3 255.255.255.255 12.0.0.2
[AR1]ip route-static 4.4.4.4 255.255.255.255 12.0.0.2
[AR2]ip route-static 34.0.0.0 255.255.255.0 23.0.0.2
[AR2]ip route-static 4.4.4.4 255.255.255.255 23.0.0.2
[AR2]ip route-static 3.3.3.3 255.255.255.255 23.0.0.2
[AR2]ip route-static 1.1.1.1 255.255.255.255 12.0.0.1
[AR3]ip route-static 1.1.1.1 255.255.255.255 23.0.0.1
[AR3]ip route-static 2.2.2.2 255.255.255.255 23.0.0.1
[AR3]ip route-static 4.4.4.4 255.255.255.255 34.0.0.2
[AR3]ip route-static 12.0.0.0 255.255.255.0 23.0.0.1
[AR4]ip route-static 1.1.1.1 255.255.255.255 34.0.0.1
[AR4]ip route-static 2.2.2.2 255.255.255.255 34.0.0.1
[AR4]ip route-static 3.3.3.3 255.255.255.255 34.0.0.1
[AR4]ip route-static 12.0.0.0 255.255.255.0 34.0.0.1
[AR4]ip route-static 23.0.0.0 255.255.255.0 34.0.0.1
实验2:默认路由,由于AR1和AR4属于末梢网络,则可以使用默认路由。到达任何地方都通过,某一个下一跳接口
[AR1]ip route-static 0.0.0.0 0.0.0.0 12.0.0.2
[AR4]ip route-static 0.0.0.0 0.0.0.0 34.0.0.1
浮动路由
实验环境:
实验3:新增AR5使用浮动路由,使AR2到AR4可以通过AR3也可以通过AR5,当AR3断开后自动跳转通过AR5到AR4
首先为新增AR5后添加路由:
[AR5]ip route-static 4.4.4.4 32 35.0.0.2
[AR5]ip route-static 34.0.0.0 24 35.0.0.2
[AR3]ip route-static 25.0.0.0 24 35.0.0.1
[AR4]ip route-static 35.0.0.0 24 34.0.0.1
[AR4]ip route-static 25.0.0.0 24 34.0.0.1
[AR2]ip route-static 4.4.4.4 32 25.0.0.1 preference 70 设置优先级。默认60数字越大优先级越低
[AR2]ip route-static 35.0.0.0 255.255.255.0 25.0.0.1
通过tracert 命令追踪
[AR2]tracert 4.4.4.4
traceroute to 4.4.4.4(4.4.4.4), max hops: 30 ,packet length: 40,press CTRL_C to break
1 23.0.0.2 20 ms 10 ms 20 ms
2 34.0.0.2 10 ms 20 ms 20 ms
shutdownAR2的g0/0/1端口以后,在追踪
[AR2-GigabitEthernet0/0/1]shutdown
[AR2]tracert 4.4.4.4
traceroute to 4.4.4.4(4.4.4.4), max hops: 30 ,packet length: 40,press CTRL_C to break
1 25.0.0.1 30 ms 10 ms 1 ms
2 35.0.0.2 10 ms 20 ms 10 ms
3 34.0.0.2 30 ms 30 ms 20 ms
当默认路由和静态路由同时存在的时候会优先选择静态路由
本文出自 “运维成长路” 博客,谢绝转载!
以上是关于华为静态,默认,浮动路由的主要内容,如果未能解决你的问题,请参考以下文章