华为交换机:三层交换机实现vlan间通信
实验环境介绍
一、划分vlan并将相应的接口加入VLAN
swh1配置
<Huawei>SYS
Enter system view, return user view with Ctrl+Z.
[Huawei]sys swh1
[swh1]
[swh1]int g0/0/1
[swh1-GigabitEthernet0/0/1]port link-type access
[swh1-GigabitEthernet0/0/1]int g0/0/2
[swh1-GigabitEthernet0/0/2]port link-type access
[swh1-GigabitEthernet0/0/2]int g0/0/3
[swh1-GigabitEthernet0/0/3]port link-type access
[swh1-GigabitEthernet0/0/3]q
[swh1]vlan 10
[swh1-vlan10]port g0/0/1
[swh1-vlan10]q
[swh1]
[swh1]vlan 20
[swh1-vlan20]
[swh1-vlan20]port g0/0/2
[swh1-vlan20]q
[swh1]vlan 30
[swh1-vlan30]port g0/0/3
查看vlan
[swh1]dis vlan
The total number of vlans is : 4
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
--------------------------------------------------------------------------------
VID Type Ports
--------------------------------------------------------------------------------
1 common UT:GE0/0/4(D) GE0/0/5(D) GE0/0/6(D) GE0/0/7(D)
GE0/0/8(D) GE0/0/9(D) GE0/0/10(D) GE0/0/11(D)
GE0/0/12(D) GE0/0/13(D) GE0/0/14(D) GE0/0/15(D)
GE0/0/16(D) GE0/0/17(D) GE0/0/18(D) GE0/0/19(D)
GE0/0/20(D) GE0/0/21(D) GE0/0/22(D) GE0/0/23(D)
GE0/0/24(D)
10 common UT:GE0/0/1(D)
20 common UT:GE0/0/2(D)
30 common UT:GE0/0/3(D)
VID Status Property MAC-LRN Statistics Description
--------------------------------------------------------------------------------
1 enable default enable disable VLAN 0001
10 enable default enable disable VLAN 0010
20 enable default enable disable VLAN 0020
30 enable default enable disable VLAN 0030
swh2配置
The device is running!
##########
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys swh2
[swh2]
[swh2]int g0/0/1
[swh2-GigabitEthernet0/0/1]port link-type access
[swh2-GigabitEthernet0/0/1]int g0/0/2
[swh2-GigabitEthernet0/0/2]port link-type access
[swh2-GigabitEthernet0/0/2]int g0/0/3
[swh2-GigabitEthernet0/0/3]port link-type access
[swh2-GigabitEthernet0/0/3]q
[swh2]vlan 10
[swh2-vlan10]port g0/0/1
[swh2-vlan10]q
[swh2]
[swh2]vlan 20
[swh2-vlan20]port g0/0/2
[swh2-vlan20]q
[swh2]vlan 30
[swh2-vlan30]port g0/0/3
[swh2-vlan30]q
[swh2]dis vlan
The total number of vlans is : 4
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;