Categories: 网络学习

华为HCIA实验-Access端口和Trunk端口实验

拓扑图

交换机互联端口为Trunk口,下联PC为Access口。Trunk口允许通过VLAN 10和20,默认只允许通过VLAN 1.

SWA配置

[SWA]vlan batch 10 20    //批量创建VLAN 1020


[SWA]int g0/0/2

[SWA-GigabitEthernet0/0/2]port link-type access //修改成access模式

[SWA-GigabitEthernet0/0/2]port default vlan 10    //加入vlan 10

[SWA-GigabitEthernet0/0/2]int g0/0/3

[SWA-GigabitEthernet0/0/3]port link-type acc

[SWA-GigabitEthernet0/0/3]port de vlan 20

[SWA-GigabitEthernet0/0/3]quit

[SWA]int g0/0/1

[SWA-GigabitEthernet0/0/1]port link-type trunk     //修改成trunk模式

[SWA-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20    //允许通过vlan 1020

[SWA-GigabitEthernet0/0/1]quit

[SWA]dis vlan

[SWA]dis port vlan act

SWB配置

[SWB]vlan batch 10 20

[SWB]int g0/0/2

[SWB-GigabitEthernet0/0/2]port link-type access

[SWB-GigabitEthernet0/0/2]port default vlan 20

[SWB]int g0/0/3

[SWB-GigabitEthernet0/0/3]port link-type access

[SWB-GigabitEthernet0/0/3]port default vlan 10

[SWB-GigabitEthernet0/0/3]int g0/0/1

[SWB-GigabitEthernet0/0/1]port link-type trunk

[SWB-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20

[SWB-GigabitEthernet0/0/1]quit

完成后测试下同一VLAN主机互通

PC1去ping PC4

PC2去ping PC3

同一VLAN都通,实验完成

王哥哥

View Comments

Share
Published by
王哥哥