用到是依旧是华为的ensp
第一步:先对192.168.1.0/24进行子网划分
由题可知会用到6个网段 ,划分后用的网段如下所示
192.168.1.0/27
192.168.1.32/27
192.168.1.64/27
192.168.1.96/27
192.168.1.128/27
192.168.1.160/27
精确后如下图
第二步:设置环回以及接口IP
[r2]interface LoopBack 0
[r2-LoopBack0]ip add 192.168.1.65 27
[r2-LoopBack0]q
[r2]interface LoopBack 1
[r2-LoopBack1]ip add 192.168.1.97 27
[r2-LoopBack1]q
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.130 27
[r2-GigabitEthernet0/0/0]q
[r2]interface GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.1.161 27
[r2-GigabitEthernet0/0/1]q
第三步:配置rip v2 并且ping一下另外两个路由器来检测前面做的没有问题,方便下一步的进行
[r2]rip 1
[r2-rip-1]version 2
[r2-rip-1]network 192.168.1.0
[r2-rip-1]q
[r1]ping -a 192.168.1.1 192.168.1.65
PING 192.168.1.65: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.65: bytes=56 Sequence=1 ttl=255 time=30 ms
Reply from 192.168.1.65: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 192.168.1.65: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 192.168.1.65: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 192.168.1.65: bytes=56 Sequence=5 ttl=255 time=20 ms
--- 192.168.1.65 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/22/30 ms
为了减少路由器的条目,需要将路由器上两个环回进行汇总,以r2为例
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]rip summary-address 192.168.1.64 255.255.255.192
[r2-GigabitEthernet0/0/0]q
[r2]interface GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/1]rip summary-address 192.168.1.64 255.255.255.192
[r2-GigabitEthernet0/0/1]q
在r1的0/0/0接口进行抓包,可以看到此时的数据并没有加密
然后给每个路由器的端口都加密,且加密的类型和密码都必须一样,可以从下图看到信息已经被加密
由于不能宣告r3的环回,所以要用到缺省路由,只用给边界路由器手动配置缺省,之后所有运行RIP的路由器都自动产生缺省
[r3-rip-1]default-route originate
分别用r1,r2 ping3.3.3.3 ,结果都可以ping通,代表整个实验完成
<r1>ping 3.3.3.3
PING 3.3.3.3: 56 data bytes, press CTRL_C to break
Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=254 time=10 ms
Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=254 time=30 ms
Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=254 time=20 ms
--- 3.3.3.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/24/30 ms
<r2>ping 3.3.3.3
PING 3.3.3.3: 56 data bytes, press CTRL_C to break
Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=255 time=10 ms
Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=255 time=10 ms
Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=255 time=20 ms
--- 3.3.3.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/16/30 ms