试验拓扑图
步骤一
IP地址规划
1.根据192.168.0.0/24划分
192.168.0.0/26(骨干链路)
192.168.0.0/30
192.168.0.4/30
192.168.0.8/30
192.168.0.12/30
192.168.0.16/30
192.168.0.20/30
192.168.0.64/26(环回汇总)
192.168.0.64/28
192.168.0.80/28
192.168.0.96/28
192.168.0.128/26(vlan2 vlan3)
192.168.0.128/27
192.168.0.192/26(预留)
R1
<Huawei>sy
[Huawei]sy R1
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.0.2 30
[R1-GigabitEthernet0/0/0]q
[R1]interface g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.0.5 30
[R1-GigabitEthernet0/0/1]q
[R1]ip route-static 192.168.0.20 30 192.168.0.6
[R1]ip route-static 192.168.0.8 30 192.168.0.6
[R1]ip route-static 192.168.0.12 30 192.168.0.6
[R1]ip route-static 192.168.0.16 30 192.168.0.6
[R1]ip route-static 192.168.0.128 26 192.168.0.6
[R1]ip route-static 192.168.0.128 26 192.168.0.1
[R1]ip route-static 192.168.0.64 26 192.168.0.1
[R1]ip route-static 0.0.0.0 0 192.168.0.6
R2
<Huawei>sy
[Huawei]sy R2
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.0.1 30
[R2-GigabitEthernet0/0/0]q
[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.0.22 30
[R2-GigabitEthernet0/0/1]q
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 192.168.0.65 28
[R2-LoopBack0]q
[R2]interface LoopBack 1
[R2-LoopBack1]ip add 192.168.0.81 28
[R2-LoopBack1]q
[R2]interface LoopBack 2
[R2-LoopBack2]ip address 192.168.0.97 28
[R2-LoopBack2]q
[R2]ip route-static 192.168.0.4 30 192.168.0.2
[R2]ip route-static 192.168.0.8 30 192.168.0.2
[R2]ip route-static 192.168.0.12 30 192.168.0.2
[R2]ip route-static 192.168.0.16 30 192.168.0.2
[R2]ip route-static 192.168.0.128 26 192.168.0.2
[R2]ip route-static 192.168.0.128 26 192.168.0.21
[R2]ip route-static 192.168.0.16 30 192.168.0.21
[R2]ip route-static 192.168.0.12 30 192.168.0.21
[R2]ip route-static 192.168.0.8 30 192.168.0.21
R3
<Huawei>sy
[Huawei]sy R3
[R3]interface g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.0.18 30
[R3-GigabitEthernet0/0/1]q
[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.0.21 30
[R3-GigabitEthernet0/0/0]q
[R3]interface g0/0/2.1
[R3-GigabitEthernet0/0/2.1]ip address 192.168.0.129 27
[R3-GigabitEthernet0/0/2.1]dot1q termination vid 2
[R3-GigabitEthernet0/0/2.1]arp broadcast enable
[R3-GigabitEthernet0/0/2.1]q
[R3]interface g0/0/2.2
[R3-GigabitEthernet0/0/2.2]ip address 192.168.0.161 27
[R3-GigabitEthernet0/0/2.2]dot1q termination vid 3
[R3-GigabitEthernet0/0/2.2]arp broadcast enabl
[R3-GigabitEthernet0/0/2.2]q
[R3]ip pool 1
[R3-ip-pool-1]network 192.168.0.128 mask 27
[R3-ip-pool-1]gateway-list 192.168.0.129
[R3-ip-pool-1]dns-list 8.8.8.8
[R3-ip-pool-1]q
[R3]dhcp enable
[R3]interface g0/0/2.1
[R3-GigabitEthernet0/0/2.1]dhcp select global
[R3-GigabitEthernet0/0/2.1]q
[R3]ip pool 2
[R3-ip-pool-2]network 192.168.0.160 mask 27
[R3-ip-pool-2]gateway-list 192.168.0.161
[R3-ip-pool-2]dns-list 8.8.8.8
[R3-ip-pool-2]q
[R3]interface g0/0/2.2
[R3-GigabitEthernet0/0/2.2]dhcp select global
[R3-GigabitEthernet0/0/2.2]q
[R3]ip route-static 192.168.0.8 30 192.168.0.17
[R3]ip route-static 192.168.0.4 30 192.168.0.17
[R3]ip route-static 192.168.0.0 30 192.168.0.22
[R3]ip route-static 192.168.0.12 30 192.168.0.17
[R3]ip route-static 192.168.0.64 26 192.168.0.22
[R3]ip route-static 192.168.0.128 26 NULL 0
[R3]ip route-static 0.0.0.0 192.168.0.17
[R3]ip route-static 0.0.0.0 0 192.168.0.17
R4
<Huawei>sy
[Huawei]sy R4
[R4]interface g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.0.6 30
[R4-GigabitEthernet0/0/0]q
[R4]interface g0/0/2
[R4-GigabitEthernet0/0/2]ip address 192.168.0.9 30
[R4-GigabitEthernet0/0/2]q
[R4]interface g4/0/0
[R4-GigabitEthernet4/0/0]ip address 192.168.0.14 30
[R4-GigabitEthernet4/0/0]q
[R4]interface g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.0.17 30
[R4-GigabitEthernet0/0/1]q
[R4]ip route-static 192.168.0.0 30 192.168.0.5
[R4]ip route-static 192.168.0.20 30 192.168.0.18
[R4]ip route-static 192.168.0.128 26 192.168.0.18
[R4]ip route-static 192.168.0.64 26 192.168.0.5
[R4]ip route-static 0.0.0.0 0 192.168.0.10 preference 80
[R4]ip route-static 0.0.0.0 0 192.168.0.13
R5
<Huawei>sy
[Huawei]R5
[R5]interface g0/0/0
[R5-GigabitEthernet0/0/0]ip add 192.168.0.10 30
[R5-GigabitEthernet0/0/0]q
[R5]interface g0/0/1
[R5-GigabitEthernet0/0/1]ip add 192.168.0.13 30
[R5-GigabitEthernet0/0/1]
[R5]ip route-static 192.168.0.20 30 192.168.0.14
[R5]ip route-static 192.168.0.4 30 192.168.0.14
[R5]ip route-static 192.168.0.0 30 192.168.0.14
[R5]ip route-static 192.168.0.16 30 192.168.0.14
[R5]ip route-static 192.168.0.128 26 192.168.0.14
[R5]ip route-static 192.168.0.64 26 192.168.0.14
[R5]interface g0/0/2
[R5-GigabitEthernet0/0/2]ip address 100.0.0.1 24
[R5-GigabitEthernet0/0/2]
[R5-GigabitEthernet0/0/2]q
[R5]ip route-static 0.0.0.0 0 100.0.0.2
[R5]acl 2000
[R5-acl-basic-2000]rule permit source any
[R5-acl-basic-2000]q
[R5]interface g0/0/2
[R5-GigabitEthernet0/0/2]nat outbound 2000
[R5-GigabitEthernet0/0/2]q
LW1
<Huawei>sy
[LW1]sy LW1
[LW1]vlan batch 2 to 3
[LW1]interface e0/0/1
[LW1-Ethernet0/0/1]port link-type trunk
[LW1-Ethernet0/0/1]port trunk allow-pass vlan all
[LW1-Ethernet0/0/1]q
[LW1]interface e0/0/2
[LW1-Ethernet0/0/2]port link-type access
[LW1-Ethernet0/0/2]port default vlan 2
[LW1-Ethernet0/0/2]q
[LW1]interface e0/0/3
[LW1-Ethernet0/0/3]port link-type access
[LW1-Ethernet0/0/3]port default vlan 3
[LW1-Ethernet0/0/3]q
[LW1]interface e0/0/4
[LW1-Ethernet0/0/4]port link-type trunk
[LW1-Ethernet0/0/4]port trunk allow-pass vlan all
[LW1-Ethernet0/0/4]q
LW2
<Huawei>sy
[Huawei]sy LW2
[LW2]vlan batch 2 to 3
[LW2]interface e0/0/1
[LW2-Ethernet0/0/1]port link-type trunk
[LW2-Ethernet0/0/1]port trunk allow-pass vlan all
[LW2-Ethernet0/0/1]q
[LW2]interface e0/0/2
[LW2-Ethernet0/0/2]port link-type access
[LW2-Ethernet0/0/2]port default vlan 2
[LW2-Ethernet0/0/2]q
[LW2]interface e0/0/3
[LW2-Ethernet0/0/3]port link-type access
[LW2-Ethernet0/0/3]port default vlan 3
[LW2-Ethernet0/0/3]q
ISP
<Huawei>sy
[Huawei]interface g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 100.0.0.2 24
[Huawei-GigabitEthernet0/0/0]q