HCia---RIP练习

本文档详细记录了一次使用RIP协议实现全网可达的配置过程。首先,在每台路由器上配置IP地址,接着创建环回接口,然后在R1和R3上启用DHCP服务进行地址分配,最后启用RIPv2宣告全网路由,确保所有PC能够互相通信。通过PC1成功ping通PC4验证了配置的有效性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

分析:
1.在每台路由器上配置ip地址
2.创建环回
3.R1,R3启用dhcp下放
4.启用ripv2宣告全网实现全网可达


配置:
R1:

[Huawei]sysname r1
[r1]interface g0/0/0	
[r1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[r1]interface g0/0/1
[r1-GigabitEthernet0/0/1]ip address 192.168.1.1 24   //配置ip地址
[r1]dhcp enable 
[r1]ip pool aa
[r1-ip-pool-aa]network 192.168.1.0 mask 24
[r1-ip-pool-aa]gateway-list 192.168.1.1
[r1-ip-pool-aa]dns-list 8.8.8.8 114.114.114.114
[r1-GigabitEthernet0/0/1]dhcp select global     //dhcp启用下放ip
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 1.1.1.1 32     //创建环回
[r1]rip 1	
[r1-rip-1]version 2    //选择v2版本
[r1-rip-1]network 1.0.0.0
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 12.0.0.0        //rip宣告

[r1]display ip routing-table protocol rip     //查看rip路由表
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
         Destinations : 4        Routes : 4        

RIP routing table status : <Active>
         Destinations : 4        Routes : 4

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        2.2.2.2/32  RIP     100  1           D   12.1.1.2        GigabitEthernet
0/0/0
        3.3.3.3/32  RIP     100  2           D   12.1.1.2        GigabitEthernet
0/0/0
       23.1.1.0/24  RIP     100  1           D   12.1.1.2        GigabitEthernet
0/0/0
    192.168.2.0/24  RIP     100  2           D   12.1.1.2        GigabitEthernet
0/0/0

RIP routing table status : <Inactive>
         Destinations : 0        Routes : 0


R2:

[Huawei]sysname r2
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[r2]interface g0/0/1
[r2-GigabitEthernet0/0/1]ip address 23.1.1.1 24    //配置ip地址
[r2]interface LoopBack 0
[r2-LoopBack0]ip address 2.2.2.2 32     //创建环回

[r2]rip 1
[r2-rip-1]version 2      //选择v2版本
[r2-rip-1]network 12.0.0.0
[r2-rip-1]network 2.0.0.0
[r2-rip-1]network 23.0.0.0   //RIP宣告


<r2>display ip routing-table protocol rip     //查看rip路由表
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
         Destinations : 4        Routes : 4        

RIP routing table status : <Active>
         Destinations : 4        Routes : 4

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.1/32  RIP     100  1           D   12.1.1.1        GigabitEthernet
0/0/0
        3.3.3.3/32  RIP     100  1           D   23.1.1.2        GigabitEthernet
0/0/1
    192.168.1.0/24  RIP     100  1           D   12.1.1.1        GigabitEthernet
0/0/0
    192.168.2.0/24  RIP     100  1           D   23.1.1.2        GigabitEthernet
0/0/1

RIP routing table status : <Inactive>
         Destinations : 0        Routes : 0

R3:

[Huawei]interface g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 23.1.1.2 24
[Huawei]interface g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 192.168.2.1 24  //配置ip地址
[Huawei]dhcp enable 
[Huawei]sysname r3	
[r3]ip pool aa
[r3-ip-pool-aa]network 192.168.2.0 mask 24	
[r3-ip-pool-aa]gateway-list 192.168.2.1
[r3-ip-pool-aa]dns-list 8.8.8.8 114.114.114.114
[r3]interface g0/0/1
[r3-GigabitEthernet0/0/1]dhcp select global    //dhcp下放
[r3]interface LoopBack 0	
[r3-LoopBack0]ip address 3.3.3.3 32    //创建环回
[r3]rip 1
[r3-rip-1]version 2      //选择v2版本
[r3-rip-1]network 3.0.0.0
[r3-rip-1]network 23.0.0.0
[r3-rip-1]network 192.168.2.0     //rip宣告

<r3>display ip routing-table protocol rip     //查看路由表
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
         Destinations : 4        Routes : 4        

RIP routing table status : <Active>
         Destinations : 4        Routes : 4

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.1/32  RIP     100  2           D   23.1.1.1        GigabitEthernet
0/0/0
        2.2.2.2/32  RIP     100  1           D   23.1.1.1        GigabitEthernet
0/0/0
       12.1.1.0/24  RIP     100  1           D   23.1.1.1        GigabitEthernet
0/0/0
    192.168.1.0/24  RIP     100  2           D   23.1.1.1        GigabitEthernet
0/0/0

结果:  PC1 ping PC4  实现了全网可达


PC>ipconfig

Link local IPv6 address...........: fe80::5689:98ff:feee:5a6
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.1.1
Physical address..................: 54-89-98-EE-05-A6
DNS server........................: 8.8.8.8
                                    114.114.114.114

PC>ping 192.168.2.253

Ping 192.168.2.253: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.253: bytes=32 seq=2 ttl=125 time=78 ms
From 192.168.2.253: bytes=32 seq=3 ttl=125 time=63 ms
From 192.168.2.253: bytes=32 seq=4 ttl=125 time=78 ms
From 192.168.2.253: bytes=32 seq=5 ttl=125 time=78 ms

--- 192.168.2.253 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/74/78 ms

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值