华为HCNA之RIP路由协议基本配置实验

导语:

RIP(Routing Information Protocol,路由信息协议)是一种内部网关协议(IGP),是一种动态路由选择协议,用于自治系统(AS)内的路由信息的传递。RIP协议基于距离矢量算法(DistanceVectorAlgorithms),使用“跳数”(即metric)来衡量到达目标地址的路由距离。

拓扑图:

华为HCNA之RIP路由协议基本配置实验_第1张图片

步骤:

1.基本配置:

如拓扑图所示,完成各个物理设备和接口的配置,并进行连通性测试。

2.使用RIPv1搭建网络:

[R1]rip
[R1-rip-1]network 10.0.0.0
[R2]rip
[R2-rip-1]network 10.0.0.0

查看路由表(仅以R1为例):

[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 11       Routes : 11       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       10.0.1.0/24  Direct  0    0           D   10.0.1.1        LoopBack0
       10.0.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
     10.0.1.255/32  Direct  0    0           D   127.0.0.1       LoopBack0
       10.0.2.0/24  RIP     100  1           D   10.0.12.2       GigabitEthernet
0/0/0
      10.0.12.0/24  Direct  0    0           D   10.0.12.1       GigabitEthernet
0/0/0
      10.0.12.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
    10.0.12.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

测试R1和R2的环回路由的连通性:

[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 11       Routes : 11       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       10.0.1.0/24  Direct  0    0           D   10.0.1.1        LoopBack0
       10.0.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
     10.0.1.255/32  Direct  0    0           D   127.0.0.1       LoopBack0
       10.0.2.0/24  RIP     100  1           D   10.0.12.2       GigabitEthernet
0/0/0
      10.0.12.0/24  Direct  0    0           D   10.0.12.1       GigabitEthernet
0/0/0
      10.0.12.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
    10.0.12.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

使用debug来查看RIP定期更新情况:

debugging rip 1
terminal debugging 
Info: Current terminal debugging is on.
terminal monitor 
Info: Current terminal monitor is on.

华为HCNA之RIP路由协议基本配置实验_第2张图片
关闭debug:

undo debugging rip 1

3.搭建RIPv2网络:

[R1]rip
[R1-rip-1]version 2
[R2]rip
[R2-rip-1]version 2

查看R1和R2的路由表信息,这里仅以R1为例:

display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 11       Routes : 11       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       10.0.1.0/24  Direct  0    0           D   10.0.1.1        LoopBack0
       10.0.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
     10.0.1.255/32  Direct  0    0           D   127.0.0.1       LoopBack0
       10.0.2.0/24  RIP     100  1           D   10.0.12.2       GigabitEthernet
0/0/0
      10.0.12.0/24  Direct  0    0           D   10.0.12.1       GigabitEthernet
0/0/0
      10.0.12.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
    10.0.12.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

测试R1和R2的连通性:

ping 10.0.2.2
  PING 10.0.2.2: 56  data bytes, press CTRL_C to break
    Reply from 10.0.2.2: bytes=56 Sequence=1 ttl=255 time=20 ms
    Reply from 10.0.2.2: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 10.0.2.2: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 10.0.2.2: bytes=56 Sequence=4 ttl=255 time=10 ms
    Reply from 10.0.2.2: bytes=56 Sequence=5 ttl=255 time=40 ms

  --- 10.0.2.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/22/40 ms

至此,简单的RIP配置实验已经完成!

你可能感兴趣的:(HCNA学习)