按照如图分配网段,划分合理的IP地址:
- 配置IP:(例如r2)
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add
[r2-GigabitEthernet0/0/0]ip address 12.0.0.2 24
Jan 7 2022 21:07:34-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]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip add
[r2-GigabitEthernet0/0/1]ip address 23.0.0.1 24
Jan 7 2022 21:07:44-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]int l0
[r2-LoopBack0]ip add
[r2-LoopBack0]ip address 2.2.2.2 24——环回配置IP
检查配置是否正确:
<r2>ping 12.0.0.1
PING 12.0.0.1: 56 data bytes, press CTRL_C to break
Reply from 12.0.0.1: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 12.0.0.1: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 12.0.0.1: bytes=56 Sequence=3 ttl=255 time=10 ms
Reply from 12.0.0.1: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 12.0.0.1: bytes=56 Sequence=5 ttl=255 time=20 ms
--- 12.0.0.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% pac