一、实验拓补二、实验需求
1、配置IP地址
2、配置RIP路由协议
3、
三、实验步骤
1、配置IP地址部分
R1:[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 26
Dec 23 2023 15:45:04-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/0]int l0
[R1-LoopBack0]ip add 192.168.1.129 27
[R1-LoopBack0]int l1
[R1-LoopBack1]ip add 192.168.1.161 27
R2:[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.1.2 26
Dec 23 2023 15:48:19-08:00 R2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.1.65 27
Dec 23 2023 15:49:00-08:00 R2 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state [R2]int LoopBack 0
[R2-LoopBack0]ip add 192.168.1.193 27
[R2-LoopBack0]int l1
[R2-LoopBack1]ip add 192.168.1.225 27
R3:[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.1.66 26
Dec 23 2023 15:51:05-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 add 3.3.3.3 24
2、宣告RIP路由协议
[R1]rip [R1-rip-1]version 2 [R1-rip-1]undo summary [R1-rip-1]network 192.168.1.0 [R1-rip-1]quit
R1RIP宣告结束
[R2]rip
[R2-rip-1]version 2
[R2-rip-1]undo summary
[R2-rip-1]network 192.168.1.0
[R2-rip-1]quit
R2RIP宣告结束
[R3]rip
[R3-rip-1]version 2
[R3-rip-1]undo summary
[R3-rip-1]network 192.168.1.0
[R3-rip-1]quit
R3RIP宣告结束
查看此时RIP路由表变化
[R1]dis ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 3 Routes : 3
RIP routing table status : <Active>
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.1.64/27 RIP 100 1 D 192.168.1.2 GigabitEthernet
0/0/0
192.168.1.192/27 RIP 100 1 D 192.168.1.2 GigabitEthernet
0/0/0
192.168.1.224/27 RIP 100 1 D 192.168.1.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
[R2]dis ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.1.128/27 RIP 100 1 D 192.168.1.1 GigabitEthernet
0/0/0
192.168.1.160/27 RIP 100 1 D 192.168.1.1 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
[R3]dis ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 6 Routes : 6
RIP routing table status : <Active>
Destinations : 6 Routes : 6
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.1.0/26 RIP 100 1 D 192.168.1.65 GigabitEthernet
0/0/0
192.168.1.64/27 RIP 100 1 D 192.168.1.65 GigabitEthernet
0/0/0
192.168.1.128/27 RIP 100 2 D 192.168.1.65 GigabitEthernet
0/0/0
192.168.1.160/27 RIP 100 2 D 192.168.1.65 GigabitEthernet
0/0/0
192.168.1.192/27 RIP 100 1 D 192.168.1.65 GigabitEthernet
0/0/0
192.168.1.224/27 RIP 100 1 D 192.168.1.65 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
只有R3中存在3.3.3.0的信息
ping 192.168.1.193
ping 192.168.1.161
若此时想要ping通3.3.3.0,方法一:配置缺省路由(工程量大)方法二:配置明细路由
或使用命令 default-route originate(在起始路由器下发一条默认路由即缺省路由) 自动下发一条缺省给网络中的其他路由器
在起始路由器(网段RIP未被宣告)下发default-route originate
则在R1、R2中可查看到缺省路由
ping 3.3.3.3
此时已全网通
五、为保证更新安全和减少路由条目
则设置密码
减少路由条目需在R1、R2上做汇总
然后分别做防环,则达成目的