首先配置两台主机的IP
PC1
PC2
重命名三台路由设备并配置端口IP:
R1
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.10.2 24
Dec 22 2022 15:33:12-08:00 R1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/0]quit
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 10.0.12.1 24
Dec 22 2022 15:33:45-08:00 R1 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R1-GigabitEthernet0/0/1]quit
R2
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.0.12.2
^
Error:Incomplete command found at '^' position.
[R2-GigabitEthernet0/0/0]ip add 10.0.12.2 24
Dec 22 2022 15:34:21-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]quit
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 10.0.23.2 24
Dec 22 2022 15:34:47-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]quit
R3
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]SYS R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 10.0.23.1 24
Dec 22 2022 15:35:09-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]quit
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.20.2
^
Error:Incomplete command found at '^' position.
[R3-GigabitEthernet0/0/1]ip add 192.168.20.2 24
Dec 22 2022 15:35:41-08:00 R3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R3-GigabitEthernet0/0/1]quit
下面进行配置关键步骤,路由之间的连通
ps:设置路由之间的联通命令是 ip route-static 目标网段 子网掩码 下一跳IP
在此处需要注意的是主机与自己的路由之间是不用管的,默认设置好网关后就是通的,而不同网段之间,或者之间间隔一个的时候下一跳永远都是下一跳,挨着的下一个。
R1
[R1]ip rou
[R1]ip route-s
[R1]ip route-static 10.0.12.0 24 10.0.12.2
[R1]ip ro
[R1]ip route-s
[R1]ip route-static 10.0.23.0 24 10.0.12.2
[R1]ip route-static 192.168.20.0 24 10.0.12.2
R2
[R2]ip ro
[R2]ip route-s
[R2]ip route-static 10.0.12.0 24 10.0.12.1
[R2]ip route-static 192.168.10.0 24 10.0.12.1
[R2]ip route-static 192.168.20.0 24 10.0.23.1
[R2]ip route-static 10.0.23.0 24 10.0.23.1
R3
[R3]ip ro
[R3]ip route-s
[R3]ip route-static 10.0.23.0 24 10.0.23.2
[R3]ip route-static 10.0.12.0 24 10.0.23.2
[R3]ip route-static 192.168.10.0 24 10.0.23.2
测试连通性
PC1——>PC2
文章来源:https://www.toymoban.com/news/detail-519441.html
PC2——>PC1
测试成功!文章来源地址https://www.toymoban.com/news/detail-519441.html
到了这里,关于ENSP:三个路由器两台主机,要求两台主机之间可以通信的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!