当前位置: 代码迷 >> 综合 >> HUAWEI——动态路由(RIPv2)
  详细解决方案

HUAWEI——动态路由(RIPv2)

热度:9   发布时间:2024-03-06 19:57:21.0

实验名称:

动态路由(RIPv2)试验

实验拓扑:

在这里插入图片描述

实验目的:

使用动态路由协议RIPv2使全网互通,PC1可以ping通PC2

实验步骤:

  1. 开启所有设备;
  2. 规划拓扑,划分网段(如拓扑图所示);
  3. 配置接口地址以及PC1和PC2的IP地址、子网掩码、网关;
  4. 进入AR1,运行RIP,版本2,关闭自动汇总,宣告直连网段192.168.1.0和12.0.0.0;
  5. 进入AR2,运行RIP,版本2,关闭自动汇总,宣告直连网段12.0.0.0和23.0.0.0;
  6. 进入AR3,运行RIP,版本2,关闭自动汇总,宣告直连网段192.168.2.0和23.0.0.0;
  7. 查看每个路由器的路由表
  8. 测试,打开PC1命令行,ping192.168.2.2;

实验命令:

AR1:

<Huawei>system-view 
[Huawei]sysname r2
[r2]int GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/1]ip address 192.168.1.1 24
[r2-GigabitEthernet0/0/1]quit [r2]int GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[r2-GigabitEthernet0/0/0]quit [r2]rip 10
[r2-rip-10]version 2
[r2-rip-10]undo summary 
[r2-rip-10]network 192.168.1.0
[r2-rip-10]network 12.0.0.0
[r2-rip-10]quit 

AR2:

<Huawei>system-view 
[Huawei]sysname r2
[r2]int GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/1]ip address 12.1.1.2 24
[r2-GigabitEthernet0/0/1]quit [r2]int GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/0]ip address 23.1.1.1 24
[r2-GigabitEthernet0/0/0]quit [r2]rip 10
[r2-rip-10]version 2
[r2-rip-10]undo summary 
[r2-rip-10]network 12.0.0.0
[r2-rip-10]network 23.0.0.0 
[r2-rip-10]quit 

AR3:

<Huawei>system-view 
[Huawei]sysname r2
[r2]int GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/1]ip address 23.1.1.2 24
[r2-GigabitEthernet0/0/1]quit [r2]int GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[r2-GigabitEthernet0/0/0]quit [r2]rip 10
[r2-rip-10]version 2
[r2-rip-10]undo summary 
[r2-rip-10]network 192.168.2.0 
[r2-rip-10]network 23.0.0.0 
[r2-rip-10]quit 

实验验证:

R1路由器路由表:

[r1]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 12       Routes : 12       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface12.1.1.0/24  Direct  0    0           D   12.1.1.1        GigabitEthernet0/0/112.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/112.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/123.1.1.0/24  RIP     100  1           D   12.1.1.2        GigabitEthernet0/0/1127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.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       InLoopBack0192.168.1.0/24  Direct  0    0           D   192.168.1.1     GigabitEthernet0/0/0192.168.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0192.168.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0192.168.2.0/24  RIP     100  2           D   12.1.1.2        GigabitEthernet0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

R2路由器路由表:

[r2]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 12       Routes : 12       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface12.1.1.0/24  Direct  0    0           D   12.1.1.2        GigabitEthernet0/0/012.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/012.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/023.1.1.0/24  Direct  0    0           D   23.1.1.1        GigabitEthernet0/0/123.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/123.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.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       InLoopBack0192.168.1.0/24  RIP     100  1           D   12.1.1.1        GigabitEthernet0/0/0192.168.2.0/24  RIP     100  1           D   23.1.1.2        GigabitEthernet0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

R3路由器路由表:

[r3]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 12       Routes : 12       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface12.1.1.0/24  RIP     100  1           D   23.1.1.1        GigabitEthernet0/0/023.1.1.0/24  Direct  0    0           D   23.1.1.2        GigabitEthernet0/0/023.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/023.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.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       InLoopBack0192.168.1.0/24  RIP     100  2           D   23.1.1.1        GigabitEthernet0/0/0192.168.2.0/24  Direct  0    0           D   192.168.2.1     GigabitEthernet0/0/1192.168.2.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1192.168.2.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

测试:

配置PC1IP地址、子网掩码、网关

在这里插入图片描述

配置PC2IP地址、子网掩码、网关

在这里插入图片描述

使用pc1pingpc2

在这里插入图片描述