如何配置思科浮動路由
如何配置思科浮動路由
思科制造的路由器、交換機(jī)和其他設(shè)備承載了全球80%的互聯(lián)網(wǎng)通信,成為硅谷中新經(jīng)濟(jì)的傳奇,那么你知道如何配置思科浮動路由嗎?下面是學(xué)習(xí)啦小編整理的一些關(guān)于如何配置思科浮動路由的相關(guān)資料,供你參考。
配置思科浮動路由的方法:
步驟1:準(zhǔn)備基本環(huán)境
首先,打開Cisco Packet tracer。購買兩臺主機(jī),兩臺交換機(jī)。兩臺路由器,并各自組成A、B網(wǎng)絡(luò),
為主機(jī)A配置IP為192.168.1.1。主機(jī)B配置192.168.3.1。
步驟2:配置路由器,是的兩個網(wǎng)絡(luò)可以ping通
打開路由器A,進(jìn)入
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路由器同一網(wǎng)段
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
同樣進(jìn)入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
這樣就將兩個路由器加入到同一網(wǎng)段。下面為路由表添加下一跳
回到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)#
通過主機(jī)Aping主機(jī)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
回到主機(jī)A查看IP信息,對設(shè)置進(jìn)行保存
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:建立浮動路由
由于之前已經(jīng)做好保存,下面直接將路由器關(guān)機(jī),購買一個MN-1FE-TX到路由器A B,為端口連線。
開機(jī)
進(jìn)入路由器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)#
進(jìn)入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)#
為了驗(yàn)證浮動路由的作用,下面我們將A路由器的2.0網(wǎng)段的網(wǎng)線剪斷,在這之前先看一下A的路由表狀態(tài)
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)#
再次進(jìn)入查看路由
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#
發(fā)現(xiàn)192.168.4.0段的路由開始生效,用主機(jī)Aping一下主機(jī)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
沒有任何問題,至此,浮動路由配置完成
實(shí)驗(yàn)結(jié)果:本次實(shí)驗(yàn)其實(shí)沒有什么難度的說,主要還是熟練,熟練了能分清楚各IP網(wǎng)段就好了。
看過文章“cisco RIP如何配置"的人還看了: