拓扑图如下
要求:全网可达
进行基础的IP配置
以R1为例:
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
May 30 2023 14:37:56-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]interface g0/0/1
[r1-GigabitEthernet0/0/1]ip address 192.168.2.1 24
May 30 2023 14:38:14-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]interface g0/0/2
[r1-GigabitEthernet0/0/2]ip address 192.168.3.1 24
May 30 2023 14:38:35-08:00 r1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
分别在每个路由上写静态并且注意优先级,以R1为例
[r1]ip route-static 192.168.4.0 24 192.168.2.2 preference 61
[r1]ip route-static 192.168.4.0 24 192.168.3.2
[r1]ip route-static 192.168.6.0 24 192.168.2.2 preference 61
[r1]ip route-static 192.168.6.0 24 192.168.3.2
再查看路由表
结果略