------------------------------------------------------------------------------------------------

第一步:基本IP通讯!

R1>en
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int s0/0
R1(config-if)#no sh
R1(config-if)#ip add 192.168.12.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#exit
R1(config)#int s0/1
R1(config-if)#no sh 
R1(config-if)#ip add 192.168.13.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#exit
R1(config)#int lo 0                         ----------------------------配置环回口
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#exit
R1(config)#

 

-------------------------------------------------------------------------------------------------

R2>en
R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int s0/0
R2(config-if)#no sh
R2(config-if)#ip add 192.168.12.2 255.255.255.0
R2(config-if)#exit
R2(config)#int lo 0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#exit

 

-------------------------------------------------------------------------------------------------

R3>en
R3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#int s0/1
R3(config-if)#no sh
R3(config-if)#ip add 192.168.13.3 255.255.255.0
R3(config-if)#exit
R3(config)#int lo 0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#exit
R3(config)#

结合上一篇,大家都应该知道现在R2和R3互相ping测试是不通的!

------------------------------------------------------------------------------------------------

第二步:配置RIPv1!

R1(config)#router rip
R1(config-router)#net 192.168.12.0
R1(config-router)#net 192.168.13.0
R1(config-router)#net 1.1.1.0
R1(config-router)#exit
R1(config)#

-------------------------------------------------------------------------------------------------


R2(config)#router rip
R2(config-router)#net 192.168.12.0
R2(config-router)#net 2.2.2.0
R2(config-router)#exit
R2(config)#
-------------------------------------------------------------------------------------------------


R3(config)#router rip
R3(config-router)#net 192.168.13.0
R3(config-router)#net 3.3.3.0 
R3(config-router)#exit
R3(config)#
-------------------------------------------------------------------------------------------------

第三步:查看路由表!

R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
 
      D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
 
      N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
 
      E1 - OSPF external type 1, E2 - OSPF external type 2
 
      i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
 
      ia - IS-IS inter area, * - candidate default, U - per-user static route
 
     
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

   192.168.12.0/24 is directly connected, Serial0/0
 
    1.0.0.0/24 is subnetted, 1 subnets
      1.1.1.0 is directly connected, Loopback0
   192.168.13.0/24 is directly connected, Serial0/1
   2.0.0.0/8 [120/1] via 192.168.12.2, 00:00:26, Serial0/0
  
3.0.0.0/8 [120/1] via 192.168.13.3, 00:00:02, Serial0/1
R1#
-------------------------------------------------------------------------------------------------

R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
 
      D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
 
      N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
 
      E1 - OSPF external type 1, E2 - OSPF external type 2
 
      i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
 
      ia - IS-IS inter area, * - candidate default, U - per-user static route
 
     
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

   192.168.12.0/24 is directly connected, Serial0/0
   1.0.0.0/8 [120/1] via 192.168.12.1, 00:00:06, Serial0/0
   192.168.13.0/24 [120/1] via 192.168.12.1, 00:00:06, Serial0/0
 
    2.0.0.0/24 is subnetted, 1 subnets
      2.2.2.0 is directly connected, Loopback0
  
3.0.0.0/8 [120/2] via 192.168.12.1, 00:00:06, Serial0/0
R2#
------------------------------------------------------------------------------------------------


R3#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
 
      D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
 
      N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
 
      E1 - OSPF external type 1, E2 - OSPF external type 2
 
      i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
 
      ia - IS-IS inter area, * - candidate default, U - per-user static route
 
     
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

   192.168.12.0/24 [120/1] via 192.168.13.1, 00:00:14, Serial0/1
   1.0.0.0/8 [120/1] via 192.168.13.1, 00:00:14, Serial0/1
   192.168.13.0/24 is directly connected, Serial0/1
   2.0.0.0/8 [120/2] via 192.168.13.1, 00:00:14, Serial0/1
 
    3.0.0.0/24 is subnetted, 1 subnets
     
3.3.3.0 is directly connected, Loopback0
R3#

-------------------------------------------------------------------------------------------------

第四步:ping测试!

R2#ping 1.1.1.1 source 2.2.2.2                        -------------------ping1.1.1.1源2.2.2.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 2.2.2.2
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/20/36 ms

-------------------------------------------------------------------------------------------------
R2#ping 3.3.3.3 source 2.2.2.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 2.2.2.2
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/46/68 ms
R2#

------------------------------------------------------------------------------------------------

第五步:配置RIPv2!

R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#end
R1#

------------------------------------------------------------------------------------------------

R2(config)#router rip 
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config-router)#end
R2#

-------------------------------------------------------------------------------------------------

R3(config)#router rip
R3(config-router)#version 2
R3(config-router)#no au
R3(config-router)#end
R3#
-------------------------------------------------------------------------------------------------

第六步:查看路由表!

R1#clear ip route *                                    -----------------先清除掉原有的路由表信息
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
 
      D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
 
      N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
 
      E1 - OSPF external type 1, E2 - OSPF external type 2
 
      i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
 
      ia - IS-IS inter area, * - candidate default, U - per-user static route
 
     
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

   192.168.12.0/24 is directly connected, Serial0/0
 
    1.0.0.0/24 is subnetted, 1 subnets
      1.1.1.0 is directly connected, Loopback0
   192.168.13.0/24 is directly connected, Serial0/1
 
    2.0.0.0/24 is subnetted, 1 subnets
      2.2.2.0 [120/1] via 192.168.12.2, 00:00:03, Serial0/0
 
    3.0.0.0/24 is subnetted, 1 subnets
     
3.3.3.0 [120/1] via 192.168.13.3, 00:00:03, Serial0/1
R1#

-------------------------------------------------------------------------------------------------

R2#clear ip route *
R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
 
      D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
 
      N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
 
      E1 - OSPF external type 1, E2 - OSPF external type 2
 
      i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
 
      ia - IS-IS inter area, * - candidate default, U - per-user static route
 
     
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

   192.168.12.0/24 is directly connected, Serial0/0
 
    1.0.0.0/24 is subnetted, 1 subnets
      1.1.1.0 [120/1] via 192.168.12.1, 00:00:02, Serial0/0
   192.168.13.0/24 [120/1] via 192.168.12.1, 00:00:02, Serial0/0
 
    2.0.0.0/24 is subnetted, 1 subnets
      2.2.2.0 is directly connected, Loopback0
 
    3.0.0.0/24 is subnetted, 1 subnets
     
3.3.3.0 [120/2] via 192.168.12.1, 00:00:02, Serial0/0
R2#

-------------------------------------------------------------------------------------------------

R3#clear ip route *
R3#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
 
      D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
 
      N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
 
      E1 - OSPF external type 1, E2 - OSPF external type 2
 
      i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
 
      ia - IS-IS inter area, * - candidate default, U - per-user static route
 
     
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

   192.168.12.0/24 [120/1] via 192.168.13.1, 00:00:02, Serial0/1
 
    1.0.0.0/24 is subnetted, 1 subnets
      1.1.1.0 [120/1] via 192.168.13.1, 00:00:02, Serial0/1
   192.168.13.0/24 is directly connected, Serial0/1
 
    2.0.0.0/24 is subnetted, 1 subnets
      2.2.2.0 [120/2] via 192.168.13.1, 00:00:02, Serial0/1
 
    3.0.0.0/24 is subnetted, 1 subnets
     
3.3.3.0 is directly connected, Loopback0
R3#

-------------------------------------------------------------------------------------------------

第七步:再次ping测试!

R3#ping 1.1.1.1 source 3.3.3.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 3.3.3.3
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/33/64 ms
R3#

------------------------------------------------------------------------------------------------
R3#ping 2.2.2.2 so
R3#ping 2.2.2.2 source 3.3.3.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 3.3.3.3
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/35/64 ms
R3#

-------------------------------------------------------------------------------------------------

本教程到这里结束了!RIP路由协议还有的知识我将会在后面的章节为大家介绍!谢谢……