ENSP:三个路由器两台主机,要求两台主机之间可以通信

在这里插入图片描述
首先配置两台主机的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
在这里插入图片描述

PC2——>PC1
在这里插入图片描述
测试成功!

  • 15
    点赞
  • 92
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值