目的:PC0 ping通 PC1
R1:
interface GigabitEthernet0/1
ip address 192.168.10.1 255.255.255.0
no shutdown #开启接口
interface GigabitEthernet0/0
ip address 192.168.20.1 255.255.255.0
no shutdown
interface Loopback0 #进入环回接口
ip address 1.1.1.1 255.255.255.255 #配置环回地址
router rip #进入rip
version 2 #rip版本为2
network 192.168.10.0 #宣告直连网段
network 192.168.20.0 #宣告直连网段
no auto-summary#关闭路由自动汇总
R2:
interface Loopback0
ip address 2.2.2.2 255.255.255.255
#其余接口配置ip这里省略
router rip
version 2
network 192.168.20.0
network 192.168.30.0
no auto-summary
R3:
interface Loopback0
ip address 3.3.3.3 255.255.255.255
#其余接口配置ip这里省略
router rip
version 2
network 192.168.0.0
network 192.168.30.0
network 192.168.40.0
no auto-summary
效果: