路由器配置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了。

 

你可能感兴趣的:(职场,串口通信,休闲,rip)