Java教程

RIP配置练习

本文主要是介绍RIP配置练习,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

 

要求分析:

1.R3自带环路,R1和R2需要配置两个环路,骨干链路自己设计 ,区域为192.168.1.0/24

2.使用RIPv2,且不能直接宣告R3环路

3.全网可达,数据安全(设置密文),汇总路由

解:

首先是网络地址的分析,需要2+1个网段2^n-2>3   --- n为3,借三位

192.168.1.0/24+3

192.168.1.0/27   ---骨干链路

        192.168.1.0/30 --- R1和R2之间的地址段

        192.168.1.4/30 ---R2和R3之间的地址段

192.168.1.32/27 ---R1环回

        192.168.1.33/28 ---R1的环回1

        192.168.1.49/28 ---R1的环回2

192.168.1.64/27 ---R2环回

        192.168.1.65/28 ---R2的环回1

        192.168.1.81/28 ---R2的环回2

此时地址已经分配完毕。

然后开始设置汇总:

R1 的汇总可以设置为192.168.1.32/27

R2 的汇总可以设置为192.168.1.64/27

这个时候不要忘记设置空接口,防止黑洞

然后就密文设置,我在R1和R2之间设置一个123456,R2和R3之间设置654321。

解题:

     基础配置

//R1
<Huawei>SYS
Enter system view, return user view with Ctrl+Z.
[Huawei]SYS  R1
[R1]inte	
[R1]interface   g0/0/0
[R1-GigabitEthernet0/0/0]ip a	
[R1-GigabitEthernet0/0/0]ip accounting
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1  30
Nov 16 2021 23:04:59-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R1-GigabitEthernet0/0/0]int l0
[R1-LoopBack0]ip a	
[R1-LoopBack0]ip address   192.168.1.33 28
[R1-LoopBack0]int l1
[R1-LoopBack1]ip  ad	
[R1-LoopBack1]ip  address  192.168.1.49  28
//配置null0空接口,防汇总环路
[R1]ip  route-static  192.168.1.32  27  null 0

//R2
[R2]int	
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip  ad	
[R2-GigabitEthernet0/0/0]ip  address  192.168.1.2 30
Nov 16 2021 23:05:52-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R2-GigabitEthernet0/0/0]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.5 30
Nov 16 2021 23:06:06-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R2-GigabitEthernet0/0/1]int l0
[R2-LoopBack0]ip  ad	
[R2-LoopBack0]ip  address   192.168.1.65  28
[R2-LoopBack0]int l1
[R2-LoopBack1]ip address 192.168.1.81 28
[R2-LoopBack1]q
//R2的空接口配置
[R2]ip  route-static  192.168.1.64  27 null0

//R3
[R3]int	
[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ip ad	
[R3-GigabitEthernet0/0/0]ip address  192.168.1.6  30
Nov 16 2021 23:06:57-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R3-GigabitEthernet0/0/0]int l0
[R3-LoopBack0]ip ad	
[R3-LoopBack0]ip address  3.3.3.0  24
Error: The specified IP address is invalid.
[R3-LoopBack0]ip address 3.3.3.1 24
[R3-LoopBack0]q
//R3自带环回接口,所以不配置null0

 配置RIP

//R1
[R1]rip
[R1-rip-1]ver	
[R1-rip-1]verify-source 	
[R1-rip-1]version 2
[R1-rip-1]net	
[R1-rip-1]network 192.168.1.0
//R2
[R2]rip 
[R2-rip-1]ver	
[R2-rip-1]verify-source
[R2-rip-1]version 2
[R2-rip-1]network 192.168.1.0
//R3
[R3]rip 
[R3-rip-1]ver	
[R3-rip-1]verify-source
[R3-rip-1]version  2
[R3-rip-1]net	
[R3-rip-1]network  192.168.1.0

 RIP汇总

//R1汇总
[R1]int	
[R1]interface  g0/0/0
[R1-GigabitEthernet0/0/0]rip s	
[R1-GigabitEthernet0/0/0]rip split-horizon
[R1-GigabitEthernet0/0/0]rip summary-address 192.168.1.32 255.255.255.224
//R2汇总
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]rip summary-address 192.168.1.64 255.255.255.224
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]rip summary-address 192.168.1.64 255.255.255.224


//R3只有一个环回不需要汇总,此时分别查看R1,R2,R3的RIP条目
//R1
<R1>display rip 1 route
 Route Flags : R - RIP
               A - Aging, G - Garbage-collect
 ----------------------------------------------------------------------------
 Peer 192.168.1.2 on GigabitEthernet0/0/0
      Destination/Mask        Nexthop     Cost   Tag     Flags   Sec
      192.168.1.4/30       192.168.1.2      1    0        RA      22
     192.168.1.64/27       192.168.1.2      1    0        RA      22
//R2
[R2]display rip 1 route
 Route Flags : R - RIP
               A - Aging, G - Garbage-collect
 ----------------------------------------------------------------------------
 Peer 192.168.1.1 on GigabitEthernet0/0/0
      Destination/Mask        Nexthop     Cost   Tag     Flags   Sec
     192.168.1.32/27       192.168.1.1      1    0        RA      25
//R3
<R3>display rip 1 route
 Route Flags : R - RIP
               A - Aging, G - Garbage-collect
 ----------------------------------------------------------------------------
 Peer 192.168.1.5 on GigabitEthernet0/0/0
      Destination/Mask        Nexthop     Cost   Tag     Flags   Sec
      192.168.1.5/30       192.168.1.5      1    0        RA      13
     192.168.1.32/27       192.168.1.5      2    0        RA      13
     192.168.1.64/27       192.168.1.5      1    0        RA      13

!!!为了安全起见,我在R1和R2之间设置密文登录,密文为123456

而R2和R3之间设置密文的密码为654321

//R1
[R1]rip
[R1-rip-1]ver	
[R1-rip-1]verify-source
[R1-rip-1]version 2
[R1-rip-1]int	
[R1-rip-1]int  g0/0/0
[R1-GigabitEthernet0/0/0]rip au	
[R1-GigabitEthernet0/0/0]rip authentication-mode   ?
  hmac-sha256  
  md5          MD5 authentication
  simple       Simple authentication
[R1-GigabitEthernet0/0/0]rip authentication-mode   md5 ?
  nonstandard  Nonstandard MD5 authentication packet format (IETF)
  usual        Huawei MD5 authentication packet format
[R1-GigabitEthernet0/0/0]rip authentication-mode   md5 u	
[R1-GigabitEthernet0/0/0]rip authentication-mode   md5 usual  c	
[R1-GigabitEthernet0/0/0]rip authentication-mode   md5 usual  cipher 123456
[R1-GigabitEthernet0/0/0]q

//R2
[R2]rip
[R2-rip-1] ver	
[R2-rip-1]version 2
[R2-rip-1]int	
[R2-rip-1]int
[R2-rip-1]int  g0/0/1
[R2-GigabitEthernet0/0/1]rip  a	
[R2-GigabitEthernet0/0/1]rip  authentication-mode   md5  us	
[R2-GigabitEthernet0/0/1]rip  authentication-mode   md5  usual   c	
[R2-GigabitEthernet0/0/1]rip  authentication-mode   md5  usual   cipher   654321
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]rip a	
[R2-GigabitEthernet0/0/0]rip authentication-mode  md5 us	
[R2-GigabitEthernet0/0/0]rip authentication-mode  md5 usual   c	
[R2-GigabitEthernet0/0/0]rip authentication-mode  md5 usual   cipher   123456
[R2-GigabitEthernet0/0/0]q

//R3
[R3]rip 
[R3-rip-1]ver	
[R3-rip-1]verify-source 	
[R3-rip-1]version 2
[R3-rip-1]int	
[R3-rip-1]int  g0/0/0
[R3-GigabitEthernet0/0/0]rip	
[R3-GigabitEthernet0/0/0]rip a	
[R3-GigabitEthernet0/0/0]rip authentication-mode   md5 u	
[R3-GigabitEthernet0/0/0]rip authentication-mode   md5 usual   c	
[R3-GigabitEthernet0/0/0]rip authentication-mode   md5 usual   cipher  654321


//再次查看rip表格,R2从之前的无效时间,重新变成周期时间
[R2]display rip 1 route
 Route Flags : R - RIP
               A - Aging, G - Garbage-collect
 ----------------------------------------------------------------------------
 Peer 192.168.1.1 on GigabitEthernet0/0/0
      Destination/Mask        Nexthop     Cost   Tag     Flags   Sec
     192.168.1.32/27       192.168.1.1     16    0        RG     104
[R2]display rip 1 route
 Route Flags : R - RIP
               A - Aging, G - Garbage-collect
 ----------------------------------------------------------------------------
 Peer 192.168.1.1 on GigabitEthernet0/0/0
      Destination/Mask        Nexthop     Cost   Tag     Flags   Sec
     192.168.1.32/27       192.168.1.1      1    0        RA       3

此时R1和R3之间互相ping通

//R1
<R1>ping 192.168.1.6
  PING 192.168.1.6: 56  data bytes, press CTRL_C to break
    Reply from 192.168.1.6: bytes=56 Sequence=1 ttl=254 time=70 ms
    Reply from 192.168.1.6: bytes=56 Sequence=2 ttl=254 time=10 ms
    Reply from 192.168.1.6: bytes=56 Sequence=3 ttl=254 time=30 ms
    Reply from 192.168.1.6: bytes=56 Sequence=4 ttl=254 time=20 ms
    Reply from 192.168.1.6: bytes=56 Sequence=5 ttl=254 time=30 ms

  --- 192.168.1.6 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/32/70 ms

//R3
<R3>ping 192.168.1.1
  PING 192.168.1.1: 56  data bytes, press CTRL_C to break
    Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=254 time=40 ms
    Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=254 time=30 ms
    Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=254 time=20 ms
    Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=254 time=20 ms
    Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=254 time=30 ms

  --- 192.168.1.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/28/40 ms

     完成!!!

这篇关于RIP配置练习的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!