首先配置兩臺(tái)主機(jī)的IP
PC1
PC2
重命名三臺(tái)路由設(shè)備并配置端口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
下面進(jìn)行配置關(guān)鍵步驟,路由之間的連通
ps:設(shè)置路由之間的聯(lián)通命令是 ip route-static 目標(biāo)網(wǎng)段 子網(wǎng)掩碼 下一跳IP
在此處需要注意的是主機(jī)與自己的路由之間是不用管的,默認(rèn)設(shè)置好網(wǎng)關(guān)后就是通的,而不同網(wǎng)段之間,或者之間間隔一個(gè)的時(shí)候下一跳永遠(yuǎn)都是下一跳,挨著的下一個(gè)。
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文章來源:http://www.zghlxwxcb.cn/news/detail-519441.html
PC2——>PC1
測試成功!文章來源地址http://www.zghlxwxcb.cn/news/detail-519441.html
到了這里,關(guān)于ENSP:三個(gè)路由器兩臺(tái)主機(jī),要求兩臺(tái)主機(jī)之間可以通信的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!