路由器配置rip(結合cdp)

小凡模擬器,ios版本爲3640,兩臺路由器R1,R2

R1:

Router>
Router>ena
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname R1
R1(config)#int s1/0
R1(config-if)#ip add 192.168.2.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#
*Mar  1 00:03:31.115: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Mar  1 00:03:32.115: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0,
 changed state to up
R1(config-if)#exit
R1(config)#router rip
R1(config-router)#network 192.168.2.0
R1(config-router)#neighbor 192.168.2.2
R1(config-router)#exit
R1(config)#exit
R1#pin
*Mar  1 00:05:22.023: %SYS-5-CONFIG_I: Configured from console by consoleg
Protocol [ip]:
Target IP address:
% Bad IP address
R1#ping 192.168.2.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/34/56 ms
R1#

R2:

Router>ena
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname R2
R2(config)#int s1/0
R2(config-if)#ip add 192.168.2.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#exit
R2#
R2#ping 192.168.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/21/48 ms
R2#

這個實驗裏面我並沒有爲任何一臺路由器配置時鐘頻率,但串口照樣可以通信,這裏另外說明一點,在cisco路由器中,CDP(路由發現協議)默認是全局啓動的,因此這裏直接用到了neighbor命令。

 

補充一個實驗(配置時鐘頻率和帶寬來實現串口通信):

R1:

Router>ena
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname R1
R1(config)#int s1/0
R1(config-if)#ip add 192.168.2.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#bandwidth 64
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#
*Mar  1 00:02:18.879: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Mar  1 00:02:19.879: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0,
 changed state to up
*Mar  1 00:02:48.847: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0,
 changed state to down
R1(config)#
*Mar  1 00:03:08.831: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0,
 changed state to upe
% Ambiguous command:  "e"
R1(config)#exit
R1#
*Mar  1 00:03:13.563: %SYS-5-CONFIG_I: Configured from console by console
R1#

R2:

Router>ena
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname R2
R2(config)#int s1/0
R2(config-if)#ip add 192.168.2.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#
*Mar  1 00:02:42.227: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Mar  1 00:02:43.227: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0,
 changed state to upexit
R2#
*Mar  1 00:02:45.455: %SYS-5-CONFIG_I: Configured from console by console

配置了時鐘頻率才能通信,否則,就算當時啓用了,過會兒又down了。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章