路由信息协议—RIP
一、基本配置
PC1、PC2、PC3分别于路由器R1、R2、R3的F0/0端口相连;三个路由器间通过串口相连。
PC1的配置信息为
PC2的配置信息为
PC3的配置信息为
二、配置路由器
1.R1的配置
Router>en ----進入特權模式
Router#config t ----進入全局配置模式
Router(config)#hostname R1 ----給路由器命名
R1(config)#int f0/0 ----進入F0/0端口
R1(config-if)#ip add 192.168.1.254 255.255.255.0 ----配置IP地址
R1(config-if)#no sh ----開啟端口
R1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
R1(config-if)#
R1(config-if)#exit
R1(config)#int s1/0 ----進入S1/0端口
R1(config-if)#ip add 10.1.1.1 255.255.255.0 ----配置IP地址
R1(config-if)#clock rate 64000 ----配置時鐘頻率
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial1/0, changed state to down
R1(config-if)#exit
R1(config)#router rip ----配置路由協議
R1(config-router)#network 10.1.1.0 ----發佈直連的網絡
R1(config-router)#network 192.168.1.0
R1(config-router)#end
2.R2的配置
Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#int f0/0
R2(config-if)#ip add 192.168.2.254 255.255.255.0
R2(config-if)#no sh
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config-if)#exit
R2(config)#int s1/1
R2(config-if)#ip add 10.1.1.2 255.255.255.0
R2(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial1/1, changed state to up
R2(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up
R2(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
R2(config)#router rip
R2(config-router)#network 10.1.1.0
R2(config-router)#network 192.168.2.0
R2(config-router)#end
3.R3的配置
Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R3
R3(config)#int f0/0
R3(config-if)#ip add 192.168.3.254 255.255.255.0
R3(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R3(config-if)#exit
R3(config)#int s1/1
R3(config-if)#clock rate 64000
R3(config-if)#ip add 10.1.2.2 255.255.255.0
R3(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial1/1, changed state to down
R3(config-if)#exit
R3(config)#router rip
R3(config-router)#network 10.1.2.0
R3(config-router)#network 192.168.3.0
R3(config-router)#end
三、验证配置
1. PC1看能否ping通PC2、PC3。
2. PC2看能否ping通PC1、PC3。
3. PC3看能否ping通PC1、PC2。
如果全部都能够互相ping通,说明配置成功。