扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
本文主要给大家主要介绍了对于路由器的IP浮动静态路由如何进行设置,并且给出了原理图和具体的而配置命令行,下面文章将给你详细介绍。
Intention:使用浮动静态路由(Floating Static Route)让全网互联,正常情况下,R1 发往R3的数据包
从e0/0(192.168.12.0)走,当e0/0断开后,R1会自动切换到e0/1(192.168.21.0),当e0/0
开启后,R1又会自动切换到浮动静态路由e0/0口。
(R1 Configuration:)
!
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Ethernet0/0
ip address 192.168.12.1 255.255.255.0
shutdown
half-duplex
!
interface Ethernet0/1
ip address 192.168.21.1 255.255.255.0
half-duplex
!
ip route 3.3.3.3 255.255.255.255 192.168.12.2
ip route 3.3.3.3 255.255.255.255 192.168.21.2 50
ip route 192.168.23.0 255.255.255.0 192.168.12.2
ip route 192.168.23.0 255.255.255.0 192.168.21.2 50
!
!
(R2 Configuration:)
!
interface Ethernet0/0
ip address 192.168.12.2 255.255.255.0
half-duplex
!
interface Ethernet0/1
ip address 192.168.21.2 255.255.255.0
half-duplex
!
interface Ethernet0/2
ip address 192.168.23.2 255.255.255.0
half-duplex
!
ip route 3.3.3.3 255.255.255.255 192.168.23.3
!
!
(R3 Configuration:)
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface Ethernet0/2
ip address 192.168.23.3 255.255.255.0
half-duplex
!
ip route 192.168.12.0 255.255.255.0 192.168.23.2
ip route 192.168.21.0 255.255.255.0 192.168.23.2
!
!
——————————–
(Inspect R1:)
r1#
r1#traceroute 3.3.3.3
Type escape sequence to abort.
Tracing the route to 3.3.3.3
1 192.168.12.2 124 msec 12 msec 48 msec
2 192.168.23.3 112 msec *160 msec
r1#
(将e0/0端口关闭 shutdown ethernet 0/0 port )
r1#
r1(config)#int e0/0
r1(config-if)#shutdown
r1#
r1#traceroute 3.3.3.3
Type escape sequence to abort.
Tracing the route to 3.3.3.3
1 192.168.21.2 144 msec 72 msec 20 msec
2 192.168.23.3 80 msec *96 msec
r1#
(将e0/0端口重新开启reopen ethernet 0/0 port )
r1#
r1#config t
r1(config)#int e0/0
r1(config-if)#no shutdown
r1#
r1#traceroute 3.3.3.3
Type escape sequence to abort.
Tracing the route to 3.3.3.3
1*
192.168.12.2 76 msec 76 msec
2 192.168.23.3 88 msec *120 msec
r1#
Notice: ip route 3.3.3.3 255.255.255.255 192.168.21.2 50(后面的50表示的是管理距离 “Distance metric for this route”)(附:管理距离(AD)和度量值(metric))
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者