天天看點

Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗

Vlan的access、trunk以及hybird接口配置實驗

文章目錄

  • Vlan的access、trunk以及hybird接口配置實驗
    • 實驗拓撲
    • 實驗思路
    • 實驗步驟
      • 1.配置PC
      • 2.再對每個與主機相連的接口配置access接口
        • SW1
        • sw2
      • 3.交換機之間配置trunk接口
        • sw1
        • sw2
      • 4.進行連通測試
        • PC1 ping PC2
        • PC1 ping PC3
        • PC1 ping PC4
        • PC1 ping PC5
        • PC3 ping PC5
        • PC3 ping PC4
    • Hybird端口配置
      • 實驗拓撲
      • 實驗需求
      • 配置交換機接口
      • 主機的聯通測試

實驗拓撲

Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗

實驗思路

  1. 先配置每一台PC的ip以及子網路遮罩
  2. 再對每個與主機相連的接口配置access接口
  3. 交換機之間配置trunk接口
  4. 進行連通測試

實驗步驟

1.配置PC

Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗
Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗
Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗
Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗
Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗

2.再對每個與主機相連的接口配置access接口

SW1

<Huawei>system-view 	
[Huawei]vlan 10	
[Huawei-vlan10]quit 
[Huawei]vlan 20	
[Huawei-vlan20]quit 
[Huawei]interface e0/0/1
[Huawei-Ethernet0/0/1]port link-type access 	
[Huawei-Ethernet0/0/1]port default vlan 10	
[Huawei-Ethernet0/0/1]quit 
[Huawei]interface E0/0/2	
[Huawei-Ethernet0/0/2]port link-type access 
[Huawei-Ethernet0/0/2]port default vlan 10	
[Huawei-Ethernet0/0/2]quit 
[Huawei]interface e0/0/3
[Huawei-Ethernet0/0/3]port link-type access 	
[Huawei-Ethernet0/0/3]port default vlan 20
[Huawei-Ethernet0/0/3]quit 
           

sw2

<Huawei>system-view 	
[Huawei]vlan 10	
[Huawei-vlan10]quit 
[Huawei]vlan 20	
[Huawei-vlan20]quit 
[Huawei]int	
[Huawei]interface e0/0/1	
[Huawei-Ethernet0/0/1]port link-type access 
[Huawei-Ethernet0/0/1]port default vlan 10
[Huawei-Ethernet0/0/1]quit 
[Huawei]interface e0/0/2
[Huawei-Ethernet0/0/2]port link-type access 	
[Huawei-Ethernet0/0/2]port default vlan 20	
[Huawei-Ethernet0/0/2]quit 

           

3.交換機之間配置trunk接口

sw1

[Huawei]interface e0/0/4
[Huawei-Ethernet0/0/4]port link-type trunk 
[Huawei-Ethernet0/0/4]port trunk allow-pass vlan 10 20	
[Huawei-Ethernet0/0/4]quit 

           

sw2

[Huawei]interface e0/0/3
[Huawei-Ethernet0/0/3]port link-type trunk 	
[Huawei-Ethernet0/0/3]port trunk allow-pass vlan 10 20
           

4.進行連通測試

PC1 ping PC2

Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗

PC1 ping PC3

Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗

PC1 ping PC4

Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗

PC1 ping PC5

Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗

PC3 ping PC5

Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗

PC3 ping PC4

Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗

Hybird端口配置

實驗拓撲

Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗

實驗需求

PC4跟PC5,可以通路PC6,但是PC4,PC5無法互相通路。

配置交換機接口

本次配置隻涉及SW2

[Huawei-Ethernet0/0/3]port link-type hybrid 
[Huawei-Ethernet0/0/3]port hybrid tagged vlan 20 100
[Huawei-Ethernet0/0/3]port hybrid pvid vlan 20
[Huawei-Ethernet0/0/3]quit 
[Huawei-Ethernet0/0/2]port link-type hybrid 
[Huawei-Ethernet0/0/2]port hybrid tagged vlan 10 100
[Huawei-Ethernet0/0/2]port hybrid pvid vlan 10
[Huawei-Ethernet0/0/2]quit 
[Huawei]interface e0/0/4
[Huawei-Ethernet0/0/4]port link-type hybrid 
[Huawei-Ethernet0/0/4]port hybrid untagged vlan 10 20 100

           

主機的聯通測試

pc4 ping pc 6

Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗

pc4 ping pc5

Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗

pc5 ping pc6

Vlan的access、trunk以及hybird接口配置實驗Vlan的access、trunk以及hybird接口配置實驗

繼續閱讀