如何配置思科浮动路由
思科制造的路由器、交换机和其他设备承载了全球80%的互联网通信,成为硅谷中新经济的传奇,那么你知道如何配置思科浮动路由吗?下面是小编整理的一些关于如何配置思科浮动路由的相关资料,供你参考。
配置思科浮动路由的方法:
步骤1:准备基本环境
首先,打开Cisco Packet tracer。购买两台主机,两台交换机。两台路由器,并各自组成A、B网络,
为主机A配置IP为192.168.1.1。主机B配置192.168.3.1。
步骤2:配置路由器,是的两个网络可以ping通
打开路由器A,进入
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastethernet 0/0
Router(config-if)#ip address 192.168.1.254 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
打开路由器B,
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastethernet 0/0
Router(config-if)#ip address 192.168.3.254 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
回到A配置与B路由器同一网段
Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastethernet 0/1
Router(config-if)#ip address 192.168.2.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
同样进入B
Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastethernet 0/1
Router(config-if)#ip address 192.168.2.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
这样就将两个路由器加入到同一网段。下面为路由表添加下一跳
回到A
Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2
Router(config)#
回到B
Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1
Router(config)#
通过主机Aping主机B,
C>ping 192.168.3.1
Pinging 192.168.3.1 with 32 bytes of data:
Reply from 192.168.3.1: bytes=32 time=0ms TTL=126
Reply from 192.168.3.1: bytes=32 time=0ms TTL=126
Reply from 192.168.3.1: bytes=32 time=0ms TTL=126
Reply from 192.168.3.1: bytes=32 time=0ms TTL=126
Ping statistics for 192.168.3.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
回到主机A查看IP信息,对设置进行保存
C 192.168.1.0/24 is directly connected, FastEthernet0/0
C 192.168.2.0/24 is directly connected, FastEthernet0/1
S 192.168.3.0/24 [1/0] via 192.168.2.2
Router#write
Building configuration...
[OK]
Router#
同样步骤到B
S 192.168.1.0/24 [1/0] via 192.168.2.1
C 192.168.2.0/24 is directly connected, FastEthernet0/1
C 192.168.3.0/24 is directly connected, FastEthernet0/0
Router#write
Building configuration...
[OK]
Router#
Router#
步骤2:建立浮动路由
由于之前已经做好保存,下面直接将路由器关机,购买一个MN-1FE-TX到路由器A B,为端口连线。
开机
进入路由器A
Router(config)#interface fastethernet 1/0
Router(config-if)#ip address 192.168.4.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#
进入B
outer>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastethernet 1/0
Router(config-if)#ip address 192.168.4.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#
这样就连通了两个路由器,再回到A
outer(config)#interface fastethernet 1/0
Router(config-if)#ip address 192.168.4.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#
Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.4.2 50
Router(config)#
回到B,
outer(config)#interface fastethernet 1/0
Router(config-if)#ip address 192.168.4.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.4.1
Router(config)#
为了验证浮动路由的作用,下面我们将A路由器的2.0网段的网线剪断,在这之前先看一下A的路由表状态
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, FastEthernet0/0
C 192.168.2.0/24 is directly connected, FastEthernet0/1
S 192.168.3.0/24 [1/0] via 192.168.2.2
C 192.168.4.0/24 is directly connected, FastEthernet1/0
Router#
下面剪断拔掉192.168.2.1的端口
Router(config)#interface fastethernet 0/1
Router(config-if)#shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
Router(config-if)#
再次进入查看路由
C 192.168.1.0/24 is directly connected, FastEthernet0/0
S 192.168.3.0/24 [50/0] via 192.168.4.2
C 192.168.4.0/24 is directly connected, FastEthernet1/0
Router#
发现192.168.4.0段的路由开始生效,用主机Aping一下主机B。
C>ping 192.168.3.1
Pinging 192.168.3.1 with 32 bytes of data:
Reply from 192.168.3.1: bytes=32 time=0ms TTL=126
Reply from 192.168.3.1: bytes=32 time=0ms TTL=126
Reply from 192.168.3.1: bytes=32 time=0ms TTL=126
Reply from 192.168.3.1: bytes=32 time=0ms TTL=126
Ping statistics for 192.168.3.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
没有任何问题,至此,浮动路由配置完成
实验结果:本次实验其实没有什么难度的说,主要还是熟练,熟练了能分清楚各IP网段就好了。