1.划分IP
如图所示
2.配置接口IP并用同网段IP去ping测试
R1配置
<Huawei>
Oct 21 2023 10:10:52-08:00 Huawei %%01IFPDT/4/IF_STATE(l)[0]:Interface GigabitEt
hernet0/0/0 has turned into UP state.
<Huawei>
Oct 21 2023 10:10:52-08:00 Huawei %%01IFPDT/4/IF_STATE(l)[1]:Interface GigabitEt
hernet0/0/1 has turned into UP state.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
Oct 21 2023 10:15:35-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]q
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.1.5. 30
^
Error: Wrong parameter found at '^' position.
[r1-GigabitEthernet0/0/1]ip add 192.168.1.5 30
Oct 21 2023 10:16:36-08:00 r1 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
R2配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
Oct 21 2023 10:19:23-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]q
[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.1.9 30
Oct 21 2023 10:19:53-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]
R3
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192,168.1.6 30
^
Error: Wrong parameter found at '^' position.
[r3-GigabitEthernet0/0/0]ip add 192.168.1.6 30
Oct 21 2023 10:22:05-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]q
[r3]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.13 30
Oct 21 2023 10:22:32-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
R4
<r4>sys
Enter system view, return user view with Ctrl+Z.
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.10 30
Error: The address already exists.
[r4-GigabitEthernet0/0/0]q
[r4]int e0/0/0
[r4-Ethernet0/0/0]ip add 192.168.1.17 30
^
Error: Unrecognized command found at '^' position.
[r4-Ethernet0/0/0]ip add 192.168.1.17 30
^
Error: Unrecognized command found at '^' position.
[r4-Ethernet0/0/0]
<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r4
[r4]int 2/0/0
^
Error: Wrong parameter found at '^' position.
[r4]int g2/0/0
[r4-GigabitEthernet2/0/0]ip add 192.168.1.17 30
Oct 21 2023 10:49:03-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet2/0/0 has entered the UP state.
[r4-GigabitEthernet2/0/0]
[r4-GigabitEthernet2/0/0]q
[r4]int g1/0/0
[r4-GigabitEthernet1/0/0]ip add 192.168.1.21 30
Oct 21 2023 10:49:34-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet1/0/0 has entered the UP state.
R5
Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r5
[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 192.168.1.18 30
Oct 21 2023 10:56:50-08:00 r5 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r5-GigabitEthernet0/0/0]
[r5-GigabitEthernet0/0/0]q
[r5]int g0/0/1
[r5-GigabitEthernet0/0/1]ip add 192.168.1.22 30
Oct 21 2023 10:57:14-08:00 r5 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r5-GigabitEthernet0/0/1]q
[r5]int g2/0/0
[r5-GigabitEthernet2/0/0]ip add 192.168.1.193 30
Oct 21 2023 10:57:46-08:00 r5 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol IP
on the interface GigabitEthernet2/0/0 has entered the UP state.
3.配置环回接口:
[R1]interface LoopBack 0 //创建接口
[R1-LoopBack0]ip add 192.168.1.33 28 //配置接口IP
[R1]interface LoopBack 1
[R1-LoopBack1]ip add 192.168.1.49 28
[R2]interface LoopBack 0
[R2-LoopBack0]ip add 192.168.1.65 28
[R2]int l 1
[R2-LoopBack1]ip add 192.168.1.81 28
[R3]int l 0
[R3-LoopBack0]ip add 192.168.1.97 28
[R3]int l 1
[R3-LoopBack1]ip add 192.168.1.113 28
[R4]int l 0
[R4-LoopBack0]ip add 192.168.1.129 28
[R4]int l 1
[R4-LoopBack1]ip add 192.168.1.145 28
[R5]int l 0
[R5-LoopBack0]ip add 192.168.1.161 28
[R5]int l 1
[R5-LoopBack1]ip add 192.168.1.177 28
4.R5配置DHCP
[R5]dhcp enable //开启DHCP服务
[R5]ip pool aa //创建池塘
[R5-ip-pool-didi]network 192.168.1.192 mask 24 //地址池网段
[R5-ip-pool-didi]gateway-list 192.168.1.193 //网关IP
[R5-ip-pool-didi]dns-list 114.114.114.114 //DNS IP
[R5]int g0/0/2
[R5-GigabitEthernet0/0/2]dhcp select global //激活接口DHCP服务功能
后面没怎么搞懂应用 让我补补课