一.实验要求
二.实验材料
AR2240路由器一台,s5700交换机3台,pc6台
三.实验思路
1.创建对应vlan,并将接口划入vlan,声明接口类型
2.在路由器上创建子接口,完整开启DHCP服务
四.实验配置
sw1
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname sw1
[sw1]vlan batch 2 to 6
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw1]int g 0/0/1
[sw1-GigabitEthernet0/0/1]port link-type access
[sw1-GigabitEthernet0/0/1]port default vlan 2
[sw1-GigabitEthernet0/0/1]int g 0/0/2
[sw1-GigabitEthernet0/0/2]port hybrid pvid vlan 3
[sw1-GigabitEthernet0/0/2]port hybrid untagged vlan 3 to 6
[sw1-GigabitEthernet0/0/3]port link-type trunk
[sw1-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 to 6
[sw1-GigabitEthernet0/0/3]int g 0/0/4
[sw1-GigabitEthernet0/0/4]port hybrid untagged vlan 3 to 6
[sw1-GigabitEthernet0/0/4]port hybrid tagged vlan 2
[sw1-GigabitEthernet0/0/4]q
[sw1]dis port vlan a
[sw1]dis port vlan active
T=TAG U=UNTAG
-------------------------------------------------------------------------------
Port Link Type PVID VLAN List
-------------------------------------------------------------------------------
GE0/0/1 access 2 U: 2
GE0/0/2 hybrid 3 U: 1 3 to 6
GE0/0/3 trunk 1 U: 1
T: 2 to 6
GE0/0/4 hybrid 1 U: 1 3 to 6
T: 2
GE0/0/5 hybrid 1 U: 1
GE0/0/6 hybrid 1 U: 1
GE0/0/7 hybrid 1 U: 1
GE0/0/8 hybrid 1 U: 1
GE0/0/9 hybrid 1 U: 1
GE0/0/10 hybrid 1 U: 1
GE0/0/11 hybrid 1 U: 1
GE0/0/12 hybrid 1 U: 1
GE0/0/13 hybrid 1 U: 1
GE0/0/14 hybrid 1 U: 1
GE0/0/15 hybrid 1 U: 1
GE0/0/16 hybrid 1 U: 1
GE0/0/17 hybrid 1 U: 1
GE0/0/18 hybrid 1 U: 1
GE0/0/19 hybrid 1 U: 1
GE0/0/20 hybrid 1 U: 1
GE0/0/21 hybrid 1 U: 1
GE0/0/22 hybrid 1 U: 1
sw2
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname sw2
[sw2]vlan b
[sw2]vlan batch
May 18 2024 13:00:44-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 4, the c
hange loop count is 0, and the maximum number of records is 4095.2 TO 6
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw2]
May 18 2024 13:00:54-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 5, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw2]vlan 2 to 6
^
Error:Too many parameters found at '^' position.
[sw2]vlan b
[sw2]vlan batch 2 to 6
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw2]int g 0/0/1
[sw2-GigabitEthernet0/0/1]port in
[sw2-GigabitEthernet0/0/1]port ii
[sw2-GigabitEthernet0/0/1]port l
[sw2-GigabitEthernet0/0/1]port link-t
[sw2-GigabitEthernet0/0/1]port link-type ac
[sw2-GigabitEthernet0/0/1]port link-type access
[sw2-GigabitEthernet0/0/1]port de
[sw2-GigabitEthernet0/0/1]port default
May 18 2024 13:11:54-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 7, the c
hange loop count is 0, and the maximum number of records is 4095.vlan 2
[sw2-GigabitEthernet0/0/1]int g
May 18 2024 13:12:04-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 8, the c
hange loop count is 0, and the maximum number of records is 4095.0/0/2
[sw2-GigabitEthernet0/0/2]port hybrid pvid vlan 4
[sw2-GigabitEthernet0/0/2]port hybrid
May 18 2024 13:12:34-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 9, the c
hange loop count is 0, and the maximum number of records is 4095.un
[sw2-GigabitEthernet0/0/2]port hybrid untagged vlan 3 to 6
[sw2-GigabitEthernet0/0/2]int
May 18 2024 13:12:54-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 10, the
change loop count is 0, and the maximum number of records is 4095.g 0/0/3
[sw2-GigabitEthernet0/0/3]port link-type trunk
[sw2-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 to 6
[sw2-GigabitEthernet0/0/3]
May 18 2024 13:13:54-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 12, the
change loop count is 0, and the maximum number of records is 4095.
[sw2-GigabitEthernet0/0/3]int g 0/0/4
[sw2-GigabitEthernet0/0/4]port link-type trunk
[sw2-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 to 6
[sw2-GigabitEthernet0/0/4]q
[sw2]dis port vlan active
T=TAG U=UNTAG
-------------------------------------------------------------------------------
Port Link Type PVID VLAN List
-------------------------------------------------------------------------------
GE0/0/1 access 2 U: 2
GE0/0/2 hybrid 4 U: 1 3 to 6
GE0/0/3 trunk 1 U: 1
T: 2 to 6
GE0/0/4 trunk 1 U: 1
T: 2 to 6
GE0/0/5 hybrid 1 U: 1
GE0/0/6 hybrid 1 U: 1
GE0/0/7 hybrid 1 U: 1
GE0/0/8 hybrid 1 U: 1
GE0/0/9 hybrid 1 U: 1
GE0/0/10 hybrid 1 U: 1
GE0/0/11 hybrid 1 U: 1
GE0/0/12 hybrid 1 U: 1
GE0/0/13 hybrid 1 U: 1
GE0/0/14 hybrid 1 U: 1
GE0/0/15 hybrid 1 U: 1
GE0/0/16 hybrid 1 U: 1
GE0/0/17 hybrid 1 U: 1
GE0/0/18 hybrid 1 U: 1
GE0/0/19 hybrid 1 U: 1
GE0/0/20 hybrid 1 U: 1
GE0/0/21 hybrid 1 U: 1
GE0/0/22 hybrid 1 U: 1
sw3
[sw3]dis this
#
sysname sw3
#
undo info-center enable
#
vlan batch 2 to 6
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
return
[sw3]int g 0/0/1
[sw3-GigabitEthernet0/0/1]port hybrid pvid vlan 5
[sw3-GigabitEthernet0/0/1]port hybrid untagged vlan 3
[sw3-GigabitEthernet0/0/3]int g 0/0/2
[sw3-GigabitEthernet0/0/2]port hybrid pvid vlan 6
[sw3-GigabitEthernet0/0/2]port hybrid untagged vlan 3 4 6
[sw3-GigabitEthernet0/0/2]int g 0/0/3
[sw3-GigabitEthernet0/0/3]po
[sw3-GigabitEthernet0/0/3]port li
[sw3-GigabitEthernet0/0/3]port link-t
[sw3-GigabitEthernet0/0/3]port link-type t
[sw3-GigabitEthernet0/0/3]port link-type trunk
[sw3-GigabitEthernet0/0/3]port t
[sw3-GigabitEthernet0/0/3]port trunk a
[sw3-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 to 6
[sw3-GigabitEthernet0/0/3]q
[sw3]dis port vlan a
[sw3]dis port vlan active
T=TAG U=UNTAG
-------------------------------------------------------------------------------
Port Link Type PVID VLAN List
-------------------------------------------------------------------------------
GE0/0/1 hybrid 5 U: 1 3
GE0/0/2 hybrid 6 U: 1 3 to 4 6
GE0/0/3 trunk 1 U: 1
T: 2 to 6
GE0/0/4 hybrid 1 U: 1
GE0/0/5 hybrid 1 U: 1
GE0/0/6 hybrid 1 U: 1
GE0/0/7 hybrid 1 U: 1
GE0/0/8 hybrid 1 U: 1
GE0/0/9 hybrid 1 U: 1
GE0/0/10 hybrid 1 U: 1
GE0/0/11 hybrid 1 U: 1
GE0/0/12 hybrid 1 U: 1
GE0/0/13 hybrid 1 U: 1
GE0/0/14 hybrid 1 U: 1
GE0/0/15 hybrid 1 U: 1
GE0/0/16 hybrid 1 U: 1
GE0/0/17 hybrid 1 U: 1
GE0/0/18 hybrid 1 U: 1
GE0/0/19 hybrid 1 U: 1
GE0/0/20 hybrid 1 U: 1
GE0/0/21 hybrid 1 U: 1
GE0/0/22 hybrid 1 U: 1
GE0/0/23 hybrid 1 U: 1
AR1
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r1
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[r1-GigabitEthernet0/0/0]
May 18 2024 13:31:20-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r1-GigabitEthernet0/0/0]int g 0/0/0.1
[r1-GigabitEthernet0/0/0.1]ip add 192.168.2.1 24
[r1-GigabitEthernet0/0/0.1]dot
[r1-GigabitEthernet0/0/0.1]dot1q te
[r1-GigabitEthernet0/0/0.1]dot1q termination v
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
May 18 2024 13:32:02-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0.1 has entered the UP state.
[r1-GigabitEthernet0/0/0.1]arp b
[r1-GigabitEthernet0/0/0.1]arp broadcast e
[r1-GigabitEthernet0/0/0.1]arp broadcast enable
[r1-GigabitEthernet0/0/0.1]q
[r1]dis ip int b
[r1]dis ip int brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.1/24 up up
GigabitEthernet0/0/0.1 192.168.2.1/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
[r1]dhcp e
[r1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r1]ip p
[r1]ip poo
[r1]ip pool xsl
Info: It's successful to create an IP address pool.
[r1-ip-pool-xsl]net
[r1-ip-pool-xsl]netbios-type
[r1-ip-pool-xsl]network 192.168.1.0 mask 24
[r1-ip-pool-xsl]ge
[r1-ip-pool-xsl]get
[r1-ip-pool-xsl]gat
[r1-ip-pool-xsl]gateway-list 192.168.1.1
[r1-ip-pool-xsl]dns
[r1-ip-pool-xsl]dns-list 8.8.8.8 114.114.114.114
[r1-ip-pool-xsl]q
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]dh
[r1-GigabitEthernet0/0/0]dhcp s
[r1-GigabitEthernet0/0/0]dhcp select g
[r1-GigabitEthernet0/0/0]dhcp select global
[r1-GigabitEthernet0/0/0]q
[r1]ip poo
[r1]ip pool xsls
Info: It's successful to create an IP address pool.
[r1-ip-pool-xsls]netw
[r1-ip-pool-xsls]network 192.168.2.0 mask 24
[r1-ip-pool-xsls]ga
[r1-ip-pool-xsls]gateway-list 192.168.2.1
[r1-ip-pool-xsls]dns
[r1-ip-pool-xsls]dns-list 8.8.8.8 114.114.114.114
[r1-ip-pool-xsls]q
[r1]int g 0/0/0.1
[r1-GigabitEthernet0/0/0.1]dhcp s
[r1-GigabitEthernet0/0/0.1]dhcp select g
[r1-GigabitEthernet0/0/0.1]dhcp select global
[r1-GigabitEthernet0/0/0.1
五.实验结论
要熟练掌握每个端口类型的收发数据帧要求,才能判断是否剥离标签列表