实验要求:
1、路由器上分别配置环回
2、连接路由器的线路网段为12.1.1.0/24、23.1.1.0/24
3、R1和R3连接的网络地址分别为192.168.1.0/24、192.168.2.0/24
4、整个网络使用RIP达到全网可达
例图如下:
实验分析:
1、配置环回使用命令 interface LoopBack 进行配置
2、三个路由器之间的接口网段为12.1.1.0/24 和23.1.1.0/24两个
3、R1和R3下连接pc端的网段使用192.168.1.0/24 和192.168.2.0/24两个
4、分别在R1、R2、R3进行RIP配置,实现全网可达
实验过程:
配置Ip
对r1进行配置
0/0/0口:
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
0/0/1口:
[r1]interface GigabitEthernet 0/0/1
[r1-GigabitEthernet0/0/1]ip address 12.0.0.1 24
配置环回接口0:
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 1.1.1.1 32
检查配置:
[r1]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.1/24 up up
GigabitEthernet0/0/1 12.0.0.1/24 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 1.1.1.1/32 up up(s)
NULL0 unassigned up up(s)
对r2进行配置:
0/0/0口:
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip address 12.0.0.2 24
0/0/1口:
[r2]interface GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/1]ip address 23.1.1.1 24
环回接口0:
[r2]interface LoopBack 0
[r2-LoopBack0]ip address 2.2.2.2 32
查看配置:
[r2]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 12.0.0.2/24 up up
GigabitEthernet0/0/1 23.1.1.1/24 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 2.2.2.2/32 up up(s)
NULL0 unassigned up up(s)
对r3进行配置:
0/0/0口:
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip address 23.1.1.2 24
0/0/1口:
[r3]interface GigabitEthernet 0/0/1
[r3-GigabitEthernet0/0/1]ip address 192.168.2.1 24
环回接口0:
[r3]interface LoopBack 0
[r3-LoopBack0]ip address 3.3.3.3 32
查看配置:
[r3]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 23.1.1.2/24 up up
GigabitEthernet0/0/1 192.168.2.1/24 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 3.3.3.3/32 up up(s)
NULL0 unassigned up up(s)
对pc端进行配置:
R1底下的pc:
R2底下的pc:
配置完成总图预览:
配置RIP:
r1:
[r1]rip 1
[r1-rip-1]version 2
[r1-rip-1]network 1.0.0.0 [r1-rip-1]network 192.168.1.0 [r1-rip-1]network 12.0.0.0
查看r1配置:
[r1]display ip routing-table protocol rip
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
2.2.2.2/32 RIP 100 1 D 12.0.0.2 GigabitEthernet0/0/1
23.1.1.0/24 RIP 100 1 D 12.0.0.2 GigabitEthernet
0/0/1
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
r2:
[r2]rip 1
[r2-rip-1]version 2
[r2-rip-1]network 2.0.0.0 [r2-rip-1]network 12.0.0.0 [r2-rip-1]network 23.0.0.0
查看r2配置:
[r2]display ip routing-table protocol rip
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
1.1.1.1/32 RIP 100 1 D 12.0.0.1 GigabitEthernet0/0/0
192.168.1.0/24 RIP 100 1 D 12.0.0.1 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
r3:
[r3]rip 1
[r3-rip-1]version 2
[r3-rip-1]network 3.0.0.0 [r3-rip-1]network 23.0.0.0 [r3-rip-1]network 192.168.2.0
查看r3配置:
[r3]display ip routing-table protocol rip
Public routing table : RIP
Destinations : 4 Routes : 4
RIP routing table status : <Active>
Destinations : 4 Routes : 4
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 RIP 100 2 D 23.1.1.1 GigabitEthernet0/0/0
2.2.2.2/32 RIP 100 1 D 23.1.1.1 GigabitEthernet
0/0/0
12.0.0.0/24 RIP 100 1 D 23.1.1.1 GigabitEthernet
0/0/0
192.168.1.0/24 RIP 100 2 D 23.1.1.1 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0