实验要求
- PC1和PC3所在接口类型为access,PVID为vlan2;PC2/4/5/6处于同一网段,其中PC2可以访问PC4/5/6;但PC4不可以访问PC6
- PC5不可以访问PC6
- PC1/3与PC2/4/5/6不在一个网段
- 所有PC通过DHCP获取IP地址,且PC1/3可以正常访问PC2/4/5/6
实验拓扑
实验配置
<Huawei>sys
[Huawei]sys sw1
[sw1]vlan batch 2 to 5
[sw1]int g0/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 hybrid
[sw1-GigabitEthernet0/0/2]port hybrid pvid vlan 3
[sw1-GigabitEthernet0/0/2]port hybrid untagged vlan 2 3 4 5
[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 to 5
[sw1-GigabitEthernet0/0/3]q
[sw1]int g0/0/4
[sw1-GigabitEthernet0/0/4]port link-type hybrid
[sw1-GigabitEthernet0/0/4]port hybrid untagged vlan 3 4 5
[sw1-GigabitEthernet0/0/4]port hybrid tagged vlan 2
<Huawei>sy
[Huawei]sys sw2
[sw2]vlan batch 2 to 5
[sw2]int g0/0/1
[sw2-GigabitEthernet0/0/1]port link-type access
[sw2-GigabitEthernet0/0/1]port default vlan 2
[sw2-GigabitEthernet0/0/1]int g0/0/2
[sw2-GigabitEthernet0/0/2]port link-type hybrid
[sw2-GigabitEthernet0/0/2]port hybrid pvid vlan 4
[sw2-GigabitEthernet0/0/2]port hybrid untagged vlan 2 to 4
[sw2-GigabitEthernet0/0/2]int g0/0/3
[sw2-GigabitEthernet0/0/3]port link-type trunk
[sw2-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 to 5
[sw2-GigabitEthernet0/0/3]int g0/0/4
[sw2-GigabitEthernet0/0/4]port hybrid tagged vlan 2 to 5
<Huawei>sy
[Huawei]sys sw3
[sw3]vlan batch 2 to 5
[sw3]int g0/0/1
[sw3-GigabitEthernet0/0/1]port link-type hybrid
[sw3-GigabitEthernet0/0/1]port hybrid untagged vlan 2 to 4
[sw3-GigabitEthernet0/0/1]int g0/0/2
[sw3-GigabitEthernet0/0/2]port link-type hybrid
[sw3-GigabitEthernet0/0/2]port hybrid untagged vlan 2 3 5
[sw3-GigabitEthernet0/0/2]int g0/0/3
[sw3-GigabitEthernet0/0/3]port link-type trunk
[sw3-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 to 5
[sw3-GigabitEthernet0/0/3]q
[Huawei]int g0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]dot1q termination vid 2
[Huawei-GigabitEthernet0/0/0.1]ip add 192.168.1.1 24
[Huawei-GigabitEthernet0/0/0.1]arp broadcast enable
[Huawei-GigabitEthernet0/0/0.1]qu
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.2.1 24
[Huawei-GigabitEthernet0/0/0]qu
[Huawei]dhcp enable
[Huawei]ip pool 1
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-1]network 192.168.1.0 mask 255.255.255.0
[Huawei-ip-pool-1]gateway-list 192.168.1.1
[Huawei-ip-pool-1]ip pool 2
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-2]network 192.168.2.0 mask 255.255.255.0
[Huawei-ip-pool-2]gateway-list 192.168.2.1
[Huawei-ip-pool-2]qu
[Huawei]int g0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]dhcp select global
[Huawei-GigabitEthernet0/0/0.1]qu
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]dhcp select global
[Huawei-GigabitEthernet0/0/0]qu
实验结果