配置SW1的vlan
Changelanguage mode, confirm? [Y/N] y
提示:改变语言模式成功。
Info:Current terminal monitor is off.
Entersystem view, return user view with Ctrl+Z.
[Huawei]sysname SW1
[SW1]vlan 10
[SW1-vlan10]vlan 20
[SW1-vlan20]vlan 30
[SW1-vlan30]qu
[SW1]int e0/0/2
[SW1-Ethernet0/0/2]port link-type access
[SW1-Ethernet0/0/2]port default vlan 10
[SW1-Ethernet0/0/2]int e0/0/3
[SW1-Ethernet0/0/3]port link-type access
[SW1-Ethernet0/0/3]port default vlan 20
[SW1-Ethernet0/0/3]int e0/0/4
[SW1-Ethernet0/0/4]port link-type access
[SW1-Ethernet0/0/4]port default vlan 30
[SW1-Ethernet0/0/4]quit
[SW1]int e0/0/1
[SW1-Ethernet0/0/1]port link-type trunk
[SW1-Ethernet0/0/1]port trunk allow-pass vlan all
[SW1-Ethernet0/0/1]quit
[SW1]interface Vlan 10
[SW1-Vlanif10]ip address 192.168.1.1 24
[SW1-Vlanif10]undo sh
[SW1-Vlanif10]int vlan 20
[SW1-Vlanif20]ip address 192.168.2.1 24
[SW1-Vlanif20]undo sh
[SW1-Vlanif20]int vlan 30
[SW1-Vlanif30]ipadd 192.168.3.1 24
[SW1-Vlanif30]undo sh
[SW1]display ip int br
*down:administratively down
^down:standby
(l):loopback
(s):spoofing
The numberof interface that is UP in Physical is 5
The numberof interface that is DOWN in Physical is 1
The numberof interface that is UP in Protocol is 4
The numberof interface that is DOWN in Protocol is 2
Interface IP Address/Mask Physical Protocol
MEth0/0/1 unassigned down down
NULL0 unassigned up up(s)
Vlanif1 unassigned up down
Vlanif10 192.168.1.1/24 up up
Vlanif20 192.168.2.1/24 up up
Vlanif30 192.168.3.1/24 up up
[SW1]display vlan
The totalnumber 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: Eth0/0/1(U) Eth0/0/5(D) Eth0/0/6(D) Eth0/0/7(D) Eth0/0/8(D) Eth0/0/9(D) Eth0/0/10(D) Eth0/0/11(D) Eth0/0/12(D) Eth0/0/13(D) Eth0/0/14(D) Eth0/0/15(D)
Eth0/0/16(D) Eth0/0/17(D) Eth0/0/18(D) Eth0/0/19(D) Eth0/0/20(D) Eth0/0/21(D) Eth0/0/22(D) GE0/0/1(D) GE0/0/2(D)
10 common UT: Eth0/0/2(U)
TG:Eth0/0/1(U) 20 common UT:Eth0/0/3(U)
TG:Eth0/0/1(U) 30 common UT:Eth0/0/4(U)
TG:Eth0/0/1(U)
VID Status Property MAC-LRN StatisticsDescription
------------------------------------------------------------------
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
配置SW2的vlan
Changelanguage mode, confirm? [Y/N] y
提示:改变语言模式成功。
Info:Current terminal monitor is off.
Entersystem view, return user view with Ctrl+Z.
[Huawei]sysname SW2
[SW2]vlan 10
[SW2-vlan10]vlan 20
[SW2-vlan20]vlan 30
[SW2-vlan30]qu
[SW2]int e0/0/2
[SW2-Ethernet0/0/2]port link-type access
[SW2-Ethernet0/0/2]port default vlan 10
[SW2-Ethernet0/0/2]int e0/0/3
[SW2-Ethernet0/0/3]port link-type access
[SW2-Ethernet0/0/3]port default vlan 20
[SW2-Ethernet0/0/3]int e0/0/4
[SW2-Ethernet0/0/4]port link-type access
[SW2-Ethernet0/0/4]port default vlan 30
[SW2-Ethernet0/0/4]qu
[SW2]int e0/0/1
[SW2-Ethernet0/0/1]port link-type trunk
[SW2-Ethernet0/0/1]port trunk allow-pass vlan all
[SW2-Ethernet0/0/1]qu
[SW2]int vlan 10
[SW2-Vlanif10]ip address 192.168.1.1 24
[SW2-Vlanif10]undo sh
[SW2-Vlanif10]int vlan 20
[SW2-Vlanif20]ip address 192.168.2.1 24
[SW2-Vlanif20]undo sh
[SW2-Vlanif20]int vlan 30
[SW2-Vlanif30]ip address 192.168.3.1 24
[SW2-Vlanif30]undo sh
[SW2-Vlanif30]qu
[SW2]display ip int br
*down:administratively down
^down:standby
(l):loopback
(s):spoofing
The numberof interface that is UP in Physical is 5
The numberof interface that is DOWN in Physical is 1
The numberof interface that is UP in Protocol is 4
The numberof interface that is DOWN in Protocol is 2
Interface IP Address/Mask Physical Protocol
MEth0/0/1 unassigned down down
NULL0 unassigned up up(s)
Vlanif1 unassigned up down
Vlanif10 192.168.1.1/24 up up
Vlanif20 192.168.2.1/24 up up
Vlanif30 192.168.3.1/24 up up
[SW2]display vlan
The totalnumber 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:Eth0/0/1(U) Eth0/0/5(D) Eth0/0/6(D) Eth0/0/7(D) Eth0/0/8(D) Eth0/0/9(D) Eth0/0/10(D) Eth0/0/11(D) Eth0/0/12(D) Eth0/0/13(D) Eth0/0/14(D) Eth0/0/15(D)
Eth0/0/16(D) Eth0/0/17(D) Eth0/0/18(D) Eth0/0/19(D) Eth0/0/20(D) Eth0/0/21(D) Eth0/0/22(D) GE0/0/1(D) GE0/0/2(D) 10 common UT:Eth0/0/2(U)
TG:Eth0/0/1(U) 20 common UT:Eth0/0/3(U)
TG:Eth0/0/1(U) 30 common UT:Eth0/0/4(U)
TG:Eth0/0/1(U)
VID Status Property MAC-LRN StatisticsDescription
------------------------------------------------------------------
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 配置完后用PC机开始互相PING
几台PC机都能互相PING通。