实验内容如下,进行相关配置:
一、具体配置
1.1 IP地址划分
由题意可知大范围的划分网段有三个,主干和两个用户,其次主干细分为2个网段供其使用,2个用户网段分别再划分为2个网段给环回使用(注意R1和R2都有2个环回接口),以下是进行划分:
192.168.1.0/26 | 192.168.1.0/27 192.168.1.32/27 |
192.168.1.64/26 | 192.168.1.64/27 192.168.1.96/27 |
192.168.1.128/26 | 192.168.1.128/27 192.168.1.160/27 |
具体配置
r1:
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 27
[r1]interface l
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 192.168.1.65 27
[r1-LoopBack0]interface LoopBack 1
[r1-LoopBack1]ip address 192.168.1.97 27
r2:
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 27
[r2-GigabitEthernet0/0/0]interface GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/1]ip address 192.168.1.33 27
[r2]interface LoopBack 0
[r2-LoopBack0]ip address 192.168.1.129 27
[r2-LoopBack0]interface LoopBack 1
[r2-LoopBack1]ip address 192.168.1.161 27
r3:
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.1.34 27
[r3]interface l
[r3]interface LoopBack 0
[r3-LoopBack0]ip address 3.3.3.1 24
1.2 启用RIPv2协议
注意3.3.3.0/24不能直接在内部路由器中宣告,在进行其他宣告时要是主类宣告,可以直接宣告192.168.1.0就可以实现内部网通,然后内外网通时需要在r3边界设置缺省路由,这样就能实现全网可达:
[r1]rip 1
[r1-rip-1]version 2
[r1-rip-1]network 192.168.1.0
[r2]rip 1
[r2-rip-1]version 2
[r2-rip-1]network 192.168.1.0
[r3]rip 1
[r3-rip-1]version 2
[r3-rip-1]network 192.168.1.0
[r3-rip-1]default-route originate
1.3手工汇总来防止环路
通过将环回接口汇总,在具体接口上进行操作,注意其掩码不能写数字只能写出具体内容:
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]rip summary-address 192.168.1.64 255.255.255.192
设置空接口来防止黑洞
[r1]ip route-static 192.168.1.64 26 null 0
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]rip summary-address 192.168.1.128 255.255.255.192
[r2-GigabitEthernet0/0/0]int g 0/0/1
[r2-GigabitEthernet0/0/1]rip summary-address 192.168.1.128 255.255.255.192
[r2]ip route-static 192.168.1.128 26 null 0
1.4 更新安全,加快收敛速度
更新安全是通过RIPv2手工认证配置,设置密钥,对信息进行加密,保障了安全性。加快收敛速度通过改小设备的计时器可以适当的加快协议收敛速度,默认 30s更新,180s失效,180s抑制,300s刷新,且计时器一旦修改全网设备需要一致。
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]rip authentication-mode md5 usual 123456
更改计时器时间
[r1-GigabitEthernet0/0/0]rip 1
[r1-rip-1]timers rip 15 90 150
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]rip authentication-mode md5 usual 123456
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]rip authentication-mode md5 usual 123456
[r2]rip 1
[r2-rip-1]timers rip 15 90 150
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]rip a
[r3-GigabitEthernet0/0/0]rip authentication-mode md5 usual 123456
[r3]rip 1
[r3-rip-1]timers rip 15 90 150
写到现在,本次实验就基本完成了,其功能都能够实现。