网络拓扑_配置hybrid端口
目的:实现不同VLAN间的PC不可互访, 但不同VLAN的PC均可以访问服务器.
例: VLAN5与VLAN10的PC不可以互通,但它们均可与服务器VLAN50互通.
拓扑图:
步骤;
1.配置PC主机的IP,掩码,网关信息
2.配置LSW1,LSW2的VLAN5,VLAN10,VLAN50
[Huawei]sysname sw1
[sw1]vlan batch 5 10 50
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]sysname sw2 //配置LSW2
[sw2]vlan batch 5 10 50
Info: This operation may take a few seconds. Please wait for a moment...done.
3.配置LSW1,LSW2与PC或服务器相连的接口PVID,以及去除标签的VLAN
[sw1]interface g0/0/1 //配置LSW1
[sw1-GigabitEthernet0/0/1]port link-type hybrid
[sw1-GigabitEthernet0/0/1]port hybrid pvid vlan 5
[sw1-GigabitEthernet0/0/1]port hybrid untagged vlan 5 50
[sw1-GigabitEthernet0/0/1]quit
[sw1]interface g0/0/2 //配置LSW1
[sw1-GigabitEthernet0/0/2]port link-type hybrid
[sw1-GigabitEthernet0/0/2]port hybrid pvid vlan 10
[sw1-GigabitEthernet0/0/2]port hybrid untagged vlan 10 50
[sw1-GigabitEthernet0/0/2]quit
[sw2]interface g0/0/1 //配置LSW2
[sw2-GigabitEthernet0/0/1]port link-type hybrid
[sw2-GigabitEthernet0/0/1]port hybrid pvid vlan 50
[sw2-GigabitEthernet0/0/1]port hybrid untagged vlan 5 10 50
[sw2-GigabitEthernet0/0/1]quit
4.配置LSW1,LSW2交换机之间通过的VLAN需要带标签
[sw1]interface g0/0/3 //配置LSW1
[sw1-GigabitEthernet0/0/3]port link-type hybrid
[sw1-GigabitEthernet0/0/3]port hybrid untagged vlan 5 10 50
[sw1-GigabitEthernet0/0/3]quit
[sw2]interface g0/0/2 //配置LSW2
[sw2-GigabitEthernet0/0/2]port link-type hybrid
[sw2-GigabitEthernet0/0/2]port hybrid untagged vlan 5 10 50
[sw2-GigabitEthernet0/0/2]quit
5.验证
- VLAN5与LAN10的主机不能通讯
- VLAN5,VLAN10的主机都能与VLAN50的服务器通讯
结束.