实验需求:1.R3环回3.3.3.0/24,不宣告此环回;
2.其他网段基于192.168.1.0/24进行划分;
3.R1与R2均存在两个环回;
4.整个网络运行ripv2;
5.全网可达,保证更新安全,减少路由条目
实验步骤:1、首先划分网段2、配置IP地址部分和环回口地址
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.65 26
[R1-GigabitEthernet0/0/0]q
[R1]int lo
[R1]int LoopBack 0
[R1-LoopBack0]ip add 192.168.1.129 27
[R1-LoopBack0]q
[R1]int lo
[R1]int LoopBack 1
[R1-LoopBack1]ip add 192.168.1.161 27
[R1-LoopBack1]q
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.1.66 26
[R2-GigabitEthernet0/0/0]q
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.1.1 26
[R2-GigabitEthernet0/0/1]q
[R2]int lo
[R2]int LoopBack 0
[R2-LoopBack0]ip add 192.168.1.193 27
[R2-LoopBack0]q
[R2]int lo
[R2]int LoopBack 1
[R2-LoopBack1]ip add 192.168.1.225 27
[R2-LoopBack1]q
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.1.2 26
[R3-GigabitEthernet0/0/0]q
[R3]int lo
[R3]int LoopBack 0
[R3-LoopBack0]ip add 3.3.3.3 24
[R3-LoopBack0]q
记得检查一下是否都是双up,有没有接错的口
3、配置动态路由协议(RIP协议)
(1)配置RIP的进程ID、进入RIP的协议视图,选择版本号2,关闭自动汇总,动态路由协议使用network命令向网络中其他的路由器宣告一下跟自己路由器直连的网段的信息
[R1]rip 1
[R1-rip-1]ver
[R1-rip-1]vers
[R1-rip-1]version 2
[R1-rip-1]undo sum
[R1-rip-1]undo summary
[R1-rip-1]netw
[R1-rip-1]network 192.168.1.0
[R1-rip-1]q
网段不写192.168.1.64的原因:rip路由在宣告时只能进行主类宣告(按照A、B、C类IP地址去划分)192属于C类,网络位为前24位,所以为192.168.1.0
[R2]rip 1
[R2-rip-1]ver
[R2-rip-1]vers
[R2-rip-1]version 2
[R2-rip-1]undo summ
[R2-rip-1]undo summary
[R2-rip-1]netw
[R2-rip-1]network 192.168.1.0
[R2-rip-1]q
[R3]rip
[R3-rip-1]vers
[R3-rip-1]version 2
[R3-rip-1]undo sum
[R3-rip-1]undo summary
[R3-rip-1]NET
[R3-rip-1]network 192.168.1.0
[R3-rip-1]Q
此时就可以试着ping一下其他路由,除了 3.3.3.3,其他都能通
rip只是宣告一下路由信息就可以实现全网通,比起静态路由更加简单
检查一下路由表,显示的都是该路由器学到的网段信息
3、实现全网通(1)配静态缺省
[R1]ip
[R1]ipr
[R1]ip rout
[R1]ip route-static 0.0.0.0 0 192.168.1.66
[R1]
[R2]ip rou
[R2]ip route
[R2]ip route-static 0.0.0.0 0 192.168.1.2
[R2]
然后就可以试着ping一下3.3.3.3来检验是否实现全网通
这个方法可行,但不适用与路由器比较多的网络
(2)在R3上配置default-route originate的命令,就能实现在R3的协议路由上下发一条默认路由,就可以在网络中所有配置rip协议的路由器中都下发一条默认路由的行为
同样,在R1上ping3.3.3.3检验一下
此时这条默认路由是rip路由产生的,刚刚是来自静态路由,优先级、host值都不一样,效果一样
4、要保证更新安全,rip2要在接口中认证在R1接口上配置一个口令,在R1发送的消息要想发送到R2上,就必须在R2上也配置一个口令,当两个接口上的口令一致时,R1上的消息R2才能收到,口令不一样,就不能收到。
[R1]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?
md5 MD5 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 usu
[R1-GigabitEthernet0/0/0]rip authentication-mode md5 usual ?
STRING<1-16>/<24,32> Plain text/Encrypted text
cipher Encryption type (Cryptogram)
plain Encryption type (Plain text)
[R1-GigabitEthernet0/0/0]rip authentication-mode md5 usual cip
[R1-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 12345
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 12345
[R2-GigabitEthernet0/0/0]
[R2-GigabitEthernet0/0/0]rip au
[R2-GigabitEthernet0/0/0]rip authentication-mode md5 usu
[R2-GigabitEthernet0/0/0]rip authentication-mode md5 usual cip
[R2-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 12345
[R2-GigabitEthernet0/0/0]
[R2-GigabitEthernet0/0/0]q
5、减少路由条目,接口汇总,并防环
在接口处汇总 在summary-address后要接汇总之后的路由
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]rip su
[R1-GigabitEthernet0/0/0]rip summary-address 192.168.1.128 255.255.255.192
[R1-GigabitEthernet0/0/0]
R2有两个接口,都要汇总
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]rip su
[R2-GigabitEthernet0/0/0]rip summary-address 192.168.1.192 255.255.255.192
[R2-GigabitEthernet0/0/0]q
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]rip summary-address 192.168.1.192 255.255.255.192
[R2-GigabitEthernet0/0/1]
[R2-GigabitEthernet0/0/1]q
检查路由表