》Huawei-R&S-网络工程师实验笔记20190609-VLAN划分综合(Access和Trunk端口)

》》实验开始,先上拓扑图参考:

Huawei-R&S-网络工程师实验笔记20190609-VLAN划分综合(Access和Trunk端口)-LMLPHP

》》》实验目标:将交换机连接主机的端口类型配置为Access端口,并划分到对应的VLAN中;将交换机互联端口配置为Trunk端口,并允许通过vlan10和vlan20.

[SWA]vlan batch        //批处理创建vlan10和vlan20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SWA]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is . [SWA]int g0//
[SWA-GigabitEthernet0//]port link-type access //配置端口G0/0/2的类型为Access端口
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]port default vlan //将端口G0/0/2加入vlan10
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is . [SWA-GigabitEthernet0//]int g0//
[SWA-GigabitEthernet0//]port link-type access //配置端口G0/0/3的类型为Access端口
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]port default vlan //将端口G0/0/3加入vlan20
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]q [SWA]int g0//
[SWA-GigabitEthernet0//]port link-type trunk //配置端口G0/0/1的类型为Trunk端口
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]port trunk allow-pass vlan //配置G0/0/1(Trunk端口)允许vlan10和vlan20通过
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]q [SWA]dis vlan //查看vlan的配置情况
The total number of vlans is :
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
--------------------------------------------------------------------------------
VID Type Ports
--------------------------------------------------------------------------------
common UT:GE0//(U) GE0//(D) GE0//(D) GE0//(D)
GE0//(D) GE0//(D) GE0//(D) GE0//(D)
GE0//(D) GE0//(D) GE0//(D) GE0//(D)
GE0//(D) GE0//(D) GE0//(D) GE0//(D)
GE0//(D) GE0//(D) GE0//(D) GE0//(D)
GE0//(D) GE0//(D) common UT:GE0//(U) TG:GE0//(U) common UT:GE0//(U) TG:GE0//(U) VID Status Property MAC-LRN Statistics Description
--------------------------------------------------------------------------------
enable default enable disable VLAN
enable default enable disable VLAN
enable default enable disable VLAN [SWA]dis port vlan active //查看vlan端口激活情况
T=TAG U=UNTAG
-------------------------------------------------------------------------------
Port Link Type PVID VLAN List
-------------------------------------------------------------------------------
GE0// trunk U: //Trunk端口 Untagged vlan1
T: //Trunk端口 Tagged vlan10 vlan20
GE0// access U: //Access端口 Untagged vlan10
GE0// access U: //Access端口 Untagged vlan20
GE0// hybrid U:
GE0// hybrid U:
GE0// hybrid U:
GE0// hybrid U:
---- More ---- [SWB]vlan batch 10 20 //在SWB上以此进行类似SWA的配置 [SWB]int g0/0/2
[SWB-GigabitEthernet0/0/2]port link-type access
[SWB-GigabitEthernet0/0/2]port default vlan 20 [SWB-GigabitEthernet0/0/2]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]q [SWB]dis vlan [SWB]dis port vlan active

》》》》配置完成后,ping测试同一vlan内主机互通情况,主机A ping 主机D、主机B ping 主机C 的测试结果如下图:

Huawei-R&S-网络工程师实验笔记20190609-VLAN划分综合(Access和Trunk端口)-LMLPHP

Huawei-R&S-网络工程师实验笔记20190609-VLAN划分综合(Access和Trunk端口)-LMLPHP

05-11 20:19