RIP协议实验
例图:
要求:
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达到全网可达
配置:
r1:
[r1]int g 0/0/1
[r1-GigabitEthernet0/0/1]ip ad 12.1.1.1 24
Mar 22 2023 17:02:24-08:00 r1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r1-GigabitEthernet0/0/1]q
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip ad 192.168.1.1 24
Mar 22 2023 17:13:10-08:00 r1 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r1-GigabitEthernet0/0/0]q
[r1]int l 1
[r1-LoopBack1]ip ad 1.1.1.1 32
[r1-LoopBack1]q
[r1]rip 1
[r1-rip-1]version 2
[r1-rip-1]undo summary
[r1-rip-1]network 1.0.0.0
[r1-rip-1]network 12.0.0.0
[r1-rip-1]network 192.168.1.0
[r1-rip-1]q
[r1]dhcp en
Info: The operation may take a few seconds. Please wait for a moment.done.
[r1]int g 0/0/1
[r1-GigabitEthernet0/0/1]dhcp s
[r1-GigabitEthernet0/0/1]dhcp select g
[r1-GigabitEthernet0/0/1]dhcp select global
[r1-GigabitEthernet0/0/1]q
[r1]ip p yyy
Info: It's successful to create an IP address pool.
[r1-ip-pool-yyy]net 192.168.1.0 mask 24
[r1-ip-pool-yyy]gate
[r1-ip-pool-yyy]gateway-list 192.168.1.1
[r1-ip-pool-yyy]dns
[r1-ip-pool-yyy]dns-list 8.8.8.8
[r1-ip-pool-yyy]q
r2:
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip ad 12.1.1.2 24
Mar 22 2023 17:03:14-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]q
[r2]int l 2
[r2-LoopBack2]ip ad 2.2.2.2 32
[r2-LoopBack2]q
[r2]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip ad 23.1.1.1 24
Mar 22 2023 17:03:54-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-GigabitEthernet0/0/1]q
[r2]rip 1
[r2-rip-1]version 2
[r2-rip-1]undo summary
[r2-rip-1]network 12.0.0.0
[r2-rip-1]network 2.0.0.0
[r2-rip-1]network 23.0.0.0
[r2-rip-1]q
r3:
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip ad 23.1.1.2 24
Mar 22 2023 17:04:19-08:00 r3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r3-GigabitEthernet0/0/0]q
[r3]int l 3
[r3-LoopBack3]ip ad 3.3.3.3 32
[r3-LoopBack3]q
[r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip ad 192.168.2.1 24
Mar 22 2023 17:13:37-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r3-GigabitEthernet0/0/1]q
[r3]rip 1
[r3-rip-1]undo summary
[r3-rip-1]network 23.0.0.0
[r3-rip-1]network 3.0.0.0
[r3-rip-1]network 192.168.2.0
[r3-rip-1]q
[r3]dhcp en
Info: The operation may take a few seconds. Please wait for a moment.done.
[r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]dhcp s
[r3-GigabitEthernet0/0/1]dhcp select g
[r3-GigabitEthernet0/0/1]dhcp select global
[r3-GigabitEthernet0/0/1]q
[r3-ip-pool-2]net 192.168.2.0 mask 24
[r3-ip-pool-2]ga
[r3-ip-pool-2]gateway-list 192.168.2.1
[r3-ip-pool-2]dns
[r3-ip-pool-2]dns-list 8.8.8.8
[r3-ip-pool-2]q
测试: