1.实验拓扑图
2.实验要求
1.全网可达
2.拓扑中所需地址全部基于192.168.0.0/24划分所得。
3.静态路由(不得使用其他动态)
4.R8环回需要汇总
3.实验步骤:
①配置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 address 192.168.0.17 28
Jul 17 2023 15:58:00-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 address 192.168.0.97 28
Jul 17 2023 15:58:16-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-GigabitEthernet0/0/1]quit
[R1]int LoopBack 0
[R1-LoopBack0]ip address 192.168.0.1 30
[R1-LoopBack1]ip address 192.168.0.65 30
[R1-LoopBack2]ip address 192.168.0.129 30
[R1-LoopBack2]quit
R2
<Huawei>sys
[Huawei]sys R2
[R2]int GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.0.18 28
Jul 20 2023 17:50:55-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 address 192.168.0.33 28
Jul 20 2023 17:51:16-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]q
R3
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R3
[R3-GigabitEthernet0/0/0]ip address 192.168.0.34 28
Jul 17 2023 16:11:15-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 address 192.168.0.82 28
Jul 17 2023 16:11:34-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-GigabitEthernet0/0/1]int g0/0/2
[R3-GigabitEthernet0/0/2]ip address 192.168.0.49 28
Jul 17 2023 16:12:05-08:00 R3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[R3-GigabitEthernet0/0/2]int g4/0/0
[R3-GigabitEthernet4/0/0]ip address 192.168.0.65 28
Jul 17 2023 16:12:31-08:00 R3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet4/0/0 has entered the UP state.
[R3-GigabitEthernet4/0/0]quit
R4
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.0.81 28
Jul 17 2023 16:24:09-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.0.98 28
Jul 17 2023 16:24:27-08:00 R4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R4-GigabitEthernet0/0/1]int g0/0/2.1
[R4-GigabitEthernet0/0/2.1]ip address 192.168.0.113 28
[R4-GigabitEthernet0/0/2.1]int g0/0/2.2
[R4-GigabitEthernet0/0/2.2]ip address 192.168.0.129 28
[R4-GigabitEthernet0/0/2.2]quit
R5
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R5
[R5-ui-console0]int g0/0/1
[R5-GigabitEthernet0/0/1]ip address 192.168.0.66 28
Jul 17 2023 16:27:58-08:00 R5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R5-GigabitEthernet0/0/1]int g0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.0.50 28
Jul 17 2023 16:28:22-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R5-GigabitEthernet0/0/0]int g0/0/2
[R5-GigabitEthernet0/0/2]ip address 100.1.1.2 24
Jul 17 2023 16:28:39-08:00 R5 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[R5-GigabitEthernet0/0/2]quit
R6
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R6
[R6-ui-console0]int g0/0/0
[R6-GigabitEthernet0/0/0]ip address 100.1.1.1 24
Jul 17 2023 16:30:48-08:00 R6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R6-GigabitEthernet0/0/0]quit
②交换机划分VLAN
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys SW1
[SW1]vlan batch 2 3
[SW1]interface GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 2
[SW1-GigabitEthernet0/0/1]int g0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 3
[SW1-GigabitEthernet0/0/2]int g0/0/3
[SW1-GigabitEthernet0/0/3]port link-type trunk
[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 3
[SW1-GigabitEthernet0/0/3]q
[Huawei]sys SW2
[SW2]vlan b
[SW2]vlan batch 2 3
[SW2]interface GigabitEthernet 0/0/1
[SW2-GigabitEthernet0/0/1]port link-type trunk
[SW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3
[SW2-GigabitEthernet0/0/1]int g
[SW2-GigabitEthernet0/0/1]int g0/0/2
[SW2-GigabitEthernet0/0/2]port link-type access
[SW2-GigabitEthernet0/0/2]port default vlan 2
[SW2-GigabitEthernet0/0/2]int g0/0/3
[SW2-GigabitEthernet0/0/3]port link-type access
[SW2-GigabitEthernet0/0/3]port default vlan 3
[SW2-GigabitEthernet0/0/3]q
③静态路由的配置
R1
[R1]ip route-static 192.168.0.32 28 192.168.0.18
[R1]ip route-static 192.168.0.64 28 192.168.0.18
[R1]ip route-static 192.168.0.48 28 192.168.0.18
[R1]ip route-static 100.1.1.0 24 192.168.0.18
[R1]ip route-static 100.1.1.0 24 192.168.0.98
[R1]ip route-static 192.168.0.48 28 192.168.0.98
[R1]ip route-static 192.168.0.64 28 192.168.0.98
[R1]ip route-static 192.168.0.80 28 192.168.0.98
[R1]ip route-static 192.168.0.112 28 192.168.0.98
[R1]ip route-static 192.168.0.128 28 192.168.0.98
R2
[R2]ip route-static 192.168.0.0 28 192.168.0.17
[R2]ip route-static 192.168.0.96 28 192.168.0.17
[R2]ip route-static 192.168.0.112 28 192.168.0.17
[R2]ip route-static 192.168.0.128 28 192.168.0.17
[R2]ip route-static 192.168.0.128 28 192.168.0.34
[R2]ip route-static 192.168.0.112 28 192.168.0.34
[R2]ip route-static 192.168.0.80 28 192.168.0.34
[R2]ip route-static 192.168.0.64 28 192.168.0.34
[R2]ip route-static 192.168.0.48 28 192.168.0.34
[R2]ip route-static 100.1.1.0 24 192.168.0.34
R3
[R3]ip route-static 192.168.0.16 28 192.168.0.33
[R3]ip route-static 192.168.0.0 28 192.168.0.33
[R3]ip route-static 192.168.0.0 28 192.168.0.81
[R3]ip route-static 192.168.0.96 28 192.168.0.81
[R3]ip route-static 192.168.0.112 28 192.168.0.81
[R3]ip route-static 192.168.0.128 28 192.168.0.81
[R3]ip route-static 100.1.1.0 24 192.168.0.66
[R3]ip route-static 100.1.1.0 24 192.168.0.50
R4
[R4]ip route-static 192.168.0.0 28 192.168.0.97
[R4]ip route-static 192.168.0.16 28 192.168.0.97
[R4]ip route-static 192.168.0.32 28 192.168.0.82
[R4]ip route-static 192.168.0.64 28 192.168.0.82
[R4]ip route-static 100.1.1.0 24 192.168.0.82
R5
[R5]ip route-static 192.168.0.32 28 192.168.0.65
[R5]ip route-static 192.168.0.32 28 192.168.0.49
[R5]ip route-static 192.168.0.80 28 192.168.0.49
[R5]ip route-static 192.168.0.80 28 192.168.0.65
[R5]ip route-static 192.168.0.16 28 192.168.0.65
[R5]ip route-static 192.168.0.16 28 192.168.0.49
[R5]ip route-static 192.168.0.96 28 192.168.0.49
[R5]ip route-static 192.168.0.96 28 192.168.0.65
[R5]ip route-static 192.168.0.0 28 192.168.0.65
[R5]ip route-static 192.168.0.0 28 192.168.0.49
[R5]ip route-static 192.168.0.112 28 192.168.0.49
[R5]ip route-static 192.168.0.112 28 192.168.0.65
[R5]ip route-static 192.168.0.128 28 192.168.0.65
[R5]ip route-static 192.168.0.128 28 192.168.0.49
R6
[R6]ip route-static 192.168.0.64 28 100.1.1.2
[R6]ip route-static 192.168.0.48 28 100.1.1.2
[R6]ip route-static 192.168.0.32 28 100.1.1.2
[R6]ip route-static 192.168.0.80 28 100.1.1.2
[R6]ip route-static 192.168.0.96 28 100.1.1.2
[R6]ip route-static 192.168.0.16 28 100.1.1.2
[R6]ip route-static 192.168.0.0 28 100.1.1.2
[R6]ip route-static 192.168.0.112 28 100.1.1.2
[R6]ip route-static 192.168.0.128 28 100.1.1.2
4.开启DHCP服务
[R4]dhcp enable
[R4]ip pool 1
[R4-ip-pool-1]network 192.168.0.112 mask 28
[R4-ip-pool-1]gateway-list 192.168.0.113
[R4-ip-pool-1]dns-list 8.8.8.8
[R4-ip-pool-1]q
[R4]ip pool 2
[R4-ip-pool-2]network 192.168.0.128 mask 28
[R4-ip-pool-2]gateway-list 192.168.0.129
[R4-ip-pool-2]dns-list 8.8.8.8
[R4-ip-pool-2]q
[R4]int GigabitEthernet 0/0/2.1
[R4-GigabitEthernet0/0/2.1]dhcp select global
[R4-GigabitEthernet0/0/2.1]int g0/0/2.2
[R4-GigabitEthernet0/0/2.2]dhcp select global
[R4-GigabitEthernet0/0/2.2]q
[R4]int GigabitEthernet 0/0/2.1
[R4-GigabitEthernet0/0/2.1]dot1q termination vid 2
[R4-GigabitEthernet0/0/2.1]int g0/0/2.2
[R4-GigabitEthernet0/0/2.2]dot1q termination vid 3
[R4-GigabitEthernet0/0/2.2]q
[R4]int GigabitEthernet 0/0/2.1
[R4-GigabitEthernet0/0/2.1]arp broadcast enable
[R4-GigabitEthernet0/0/2.1]int g0/0/2.2
[R4-GigabitEthernet0/0/2.2]arp broadcast enable
[R4-GigabitEthernet0/0/2.2]q
4.测试
<1>.路由之间全网通:
R1ping R6
R1ping R2