首先新建一个拓扑图,并连接启动;
改名为r1
[Huawei]sysname r1
配置IP
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
Jul 9 2022 01:18:18-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]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.2.1 24
Jul 9 2022 01:18:41-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]ip route-static 192.168.3.0 255.255.255.0 192.168.2.2
[r1]ip route-static 192.168.4.0 255.255.255.0 192.168.2.2
[r1]ip route-static 192.168.5.0 255.255.255.0 192.168.2.2
修改名为r2
[Huawei]sysname r2
进入对应接口配置IP
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]
[r2-GigabitEthernet0/0/0]ip add 192.168.3.1 24
Jul 9 2022 01:23:11-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 g0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.2.2 24
Jul 9 2022 01:23:51-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 g0/0/2
[r2-GigabitEthernet0/0/2]ip add 192.168.4.1 24
Jul 9 2022 01:24:15-08:00 r2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
配置静态路由
[r2]ip route-static 192.168.1.0 24 192.168.2.1
[r2]ip route-static 192.168.5.0 24 192.168.4.2
修改名为r3
[Huawei]sysname r3
进入对应的接口配置IP
[r3]interface g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.5.1 24
Jul 9 2022 01:25:11-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]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.4.2 24
Jul 9 2022 01:25:36-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]ip route-static 192.168.1.0 24 192.168.4.1
[r3]ip route-static 192.168.2.0 24 192.168.4.1
[r3]ip route-static 192.168.3.0 24 192.168.4.1
配置完的PC1 PC2 PC3
PC1pingPC2
PC1pingPC3
PC2pingPC1
PC2pingPC3
PC3pingPC1
PC3pingPC1