需求分析
- 路由器上分别配置环回
- 连接路由器的线路网段为12.1.1.0/24、23.1.1.0/24
- R1和R3连接的网络地址分别为192.168.1.0/24、192.168.2.0/24
- 整个网络使用RIP达到全网可达
配置
配置路由器接口ip地址,环回
r1:
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
May 3 2023 21:51:02-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r1-GigabitEthernet0/0/0]q
[r1]int g 0/0/1
[r1-GigabitEthernet0/0/1]ip add 12.1.1.1 24
May 3 2023 21:51:49-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r1-GigabitEthernet0/0/1]q
[r1]int l 0
[r1-LoopBack0]ip add 1.1.1.1 32
[r1-LoopBack0]
r2:
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
May 3 2023 21:55:38-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r2-GigabitEthernet0/0/0]q
[r2]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip add 23.1.1.1 24
May 3 2023 21:56:22-08:00 r2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r2-GigabitEthernet0/0/1]q
[r2]int l 0
[r2-LoopBack0]ip add 2.2.2.2 32
[r2-LoopBack0]
r3:
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 23.1.1.2 24
[r3-GigabitEthernet0/0/0]
May 3 2023 21:58:12-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]q
[r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.2.1 24
May 3 2023 21:59:10-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r3-GigabitEthernet0/0/1]q
[r3]int l 0
[r3-LoopBack0]ip add 3.3.3.3/32
^
Error: Wrong parameter found at '^' position.
[r3-LoopBack0]ip add 3.3.3.3 32
[r3-LoopBack0]q
配置pcIP地址
[r1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r1]ip pool 1
Info: It's successful to create an IP address pool.
[r1-ip-pool-1]network 192.168.1.0 mask 24
[r1-ip-pool-1]ga
[r1-ip-pool-1]gateway-list 192.168.1.1
[r1-ip-pool-1]dns
[r1-ip-pool-1]dns-list 8.8.8.8
[r1-ip-pool-1]q
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]dhcp se
[r1-GigabitEthernet0/0/0]dhcp select
[r1-GigabitEthernet0/0/0]dhcp server
[r1-GigabitEthernet0/0/0]dhcp select g
[r1-GigabitEthernet0/0/0]dhcp select global
[r1-GigabitEthernet0/0/0]q
pc1:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe8b:3ba3
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.1.1
Physical address..................: 54-89-98-8B-3B-A3
DNS server........................: 8.8.8.8
pc2:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fea5:15f5
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.1.1
Physical address..................: 54-89-98-A5-15-F5
DNS server........................: 8.8.8.8
[r3]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r3]ip pool 3
Info: It's successful to create an IP address pool.
[r3-ip-pool-3]network 192.168.2.0 mask 24
[r3-ip-pool-3]da
[r3-ip-pool-3]ga
[r3-ip-pool-3]gateway-list 192.168.2.1
[r3-ip-pool-3]dns
[r3-ip-pool-3]dns-list 8.8.8.8
[r3-ip-pool-3]q
[r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]dhcp se
[r3-GigabitEthernet0/0/1]dhcp select g
[r3-GigabitEthernet0/0/1]dhcp select global
[r3-GigabitEthernet0/0/1]q
pc3:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe0c:655d
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.2.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.2.1
Physical address..................: 54-89-98-0C-65-5D
DNS server........................: 8.8.8.8
pc4:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe12:624b
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.2.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.2.1
Physical address..................: 54-89-98-12-62-4B
DNS server........................: 8.8.8.8
RIP宣告
r1:
[r1]rip 1
[r1-rip-1]ver
[r1-rip-1]verify-source
[r1-rip-1]version 1
[r1-rip-1]network 12.1.1.0
Error: The network address is invalid, and the specified address must be major-n
et address without any subnets.
[r1-rip-1]network 12.0.0.0
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 1.0.0.0
[r1-rip-1]q
r2:
[r2]rip 1
[r2-rip-1]ver
[r2-rip-1]verify-source
[r2-rip-1]version 1
[r2-rip-1]network 12.0.0.0
[r2-rip-1]network 23.0.0.0
[r2-rip-1]network 2.0.0.0
[r2-rip-1]q
r3:
[r3]rip 1
[r3-rip-1]version 1
[r3-rip-1]network 23.0.0.0
[r3-rip-1]192,168.2.0
^
Error: Unrecognized command found at '^' position.
[r3-rip-1]network 192.168.2.0
[r3-rip-1]network 3.0.0.0
[r3-rip-1]q
检验
PC>ping 1.1.1.1
Ping 1.1.1.1: 32 data bytes, Press Ctrl_C to break
From 1.1.1.1: bytes=32 seq=1 ttl=255 time=31 ms
From 1.1.1.1: bytes=32 seq=2 ttl=255 time=47 ms
From 1.1.1.1: bytes=32 seq=3 ttl=255 time=32 ms
From 1.1.1.1: bytes=32 seq=4 ttl=255 time=31 ms
From 1.1.1.1: bytes=32 seq=5 ttl=255 time=47 ms
--- 1.1.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/37/47 ms
PC>ping 2.2.2.2
Ping 2.2.2.2: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 2.2.2.2: bytes=32 seq=2 ttl=254 time=47 ms
From 2.2.2.2: bytes=32 seq=3 ttl=254 time=63 ms
From 2.2.2.2: bytes=32 seq=4 ttl=254 time=31 ms
From 2.2.2.2: bytes=32 seq=5 ttl=254 time=47 ms
--- 2.2.2.2 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/47/63 ms
PC>ping 3.3.3.3
Ping 3.3.3.3: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 3.3.3.3: bytes=32 seq=2 ttl=253 time=63 ms
From 3.3.3.3: bytes=32 seq=3 ttl=253 time=62 ms
From 3.3.3.3: bytes=32 seq=4 ttl=253 time=63 ms
From 3.3.3.3: bytes=32 seq=5 ttl=253 time=62 ms
--- 3.3.3.3 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/62/63 ms
PC>ping 192.168.2.254
Ping 192.168.2.254: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.254: bytes=32 seq=2 ttl=125 time=79 ms
From 192.168.2.254: bytes=32 seq=3 ttl=125 time=78 ms
From 192.168.2.254: bytes=32 seq=4 ttl=125 time=78 ms
From 192.168.2.254: bytes=32 seq=5 ttl=125 time=78 ms
--- 192.168.2.254 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/78/79 ms