http://hi.baidu.com/492311578
配置RIP 时,必须注意IP的规划问题。
RIP 不支持可变长子网。
RIP 配置命令
全局模式下 route rip
Network A.B.C.D
IP 配置
PC0
172.16.10.2网关 172.16.10.1
PC1
172.17.10.1 网关 172.17.10.1
R1 配置
R1(config)#int s0/0
R1(config-if)#no shu
%LINK-5-CHANGED: Interface Serial0/0, changed state to down
R1(config-if)#ip address 192.168.10.1 255.255.255.0
R1(config-if)#clock rate 000
R1(config-if)#exit
R1(config)#int s0/1
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/1, changed state to down
R1(config-if)#ip address 192.168.20.1 255.255.255.0
R1(config-if)#clock rate 000
R1(config)#route rip
R1(config-router)#network 192.168.10.0
R1(config-router)#network 192.168.20.0
R2 配置
R2(config)#int s0/0
R2(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0, changed state to up
R2(config-if)#ip address 192.168.
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
^
% Invalid input detected at '^' marker.
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2(config-if)#exit
R2(config)#int f0/0
R2(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
R2(config-if)#ip address 172.16.10.1 255.255.0.0
R2(config-if)#exit
R2(config)#int s0/0
R2(config-if)#no shutdown
R2(config-if)#ip address 192.168.10.2 255.255.255.0
R2(config-if)#exit
R2(config)#router rip
R2(config-router)#network 192.168.10.0
R2(config-router)#network 172.16.0.0
R3路由配置
R3(config)#int s0/1
R3(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to up
^
R3(config-if)#ip address 192.168.20.2 255.255.255.0
R3(config-if)#exit
R3(config)#int f0/0
R3(config-if)#no shu
%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)#ip address 172.17.10.1 255.255.0.0
R3(config-if)#exit
R3(config)#route rip
R3(config-router)#network 192.168.20.0
R3(config-router)#network 172.17.0.0
查看路由表
R1
R1#show ip route
R 172.16.0.0/16 [120/1] via 192.168.10.2, 00:00:16, Serial0/0
R 172.17.0.0/16 [120/1] via 192.168.20.2, 00:00:14, Serial0/1
C 192.168.10.0/24 is directly connected, Serial0/0
C 192.168.20.0/24 is directly connected, Serial0/1
R2
R2#show ip route
C 172.16.0.0/16 is directly connected, FastEthernet0/0
R 172.17.0.0/16 [120/2] via 192.168.10.1, 00:00:18, Serial0/0
C 192.168.10.0/24 is directly connected, Serial0/0
R 192.168.20.0/24 [120/1] via 192.168.10.1, 00:00:18, Serial0/0
R3
R3#show ip route
R 172.16.0.0/16 [120/2] via 192.168.20.1, 00:00:07, Serial0/1
C 172.17.0.0/16 is directly connected, FastEthernet0/0
R 192.168.10.0/24 [120/1] via 192.168.20.1, 00:00:07, Serial0/1
C 192.168.20.0/24 is directly connected, Serial0/1
测试
PC0 >>PC1
PC>ping 172.17.10.2
Pinging 172.17.10.2 with 32 bytes of data:
Reply from 172.17.10.2: bytes=32 time=125ms TTL=125
Reply from 172.17.10.2: bytes=32 time=125ms TTL=125
Reply from 172.17.10.2: bytes=32 time=125ms TTL=125
Reply from 172.17.10.2: bytes=32 time=124ms TTL=125
Ping statistics for 172.17.10.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 124ms, Maximum = 125ms, Average = 124ms
PC1>>>PC0
PC>ping 172.16.10.2
Pinging 172.16.10.2 with 32 bytes of data:
Reply from 172.16.10.2: bytes=32 time=141ms TTL=125
Reply from 172.16.10.2: bytes=32 time=109ms TTL=125
Reply from 172.16.10.2: bytes=32 time=125ms TTL=125
Reply from 172.16.10.2: bytes=32 time=109ms TTL=125
Ping statistics for 172.16.10.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 109ms, Maximum = 141ms, Average = 121ms
BY: 小福仔 更多教程请进
http://hi.baidu.com/492311578