目录
一、题目拓扑
二、实验要求
1、pc1和pc3所在接口为access;属于vlan 2;
pc2/pc4/pc5/pc6处于同一网段:其中pc2可以访问pc4/pc5/pc6,pc4可以访问pc6
2、pc5不能访问pc6;
3、PC4pc1/pc3与pc2/pc4/pc5/pc6不在同一网段;
4、所有pc通过DHCP获取Ip地址,且pc1/pc3可以正常访问pc2/pc4/pc5/pc6;
三、实验步骤
3.1 创建VLAN
[sw1]vlan batch 2 to 6
[sw2]vlan batch 2 to
Jul 24 2024 16:38:39-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.6
[sw3]vlan batch 2 to 6
3.2 各个接口类型的配置
SW1:
[sw1]int g 0/0/1
[sw1-GigabitEthernet0/0/1]port l
[sw1-GigabitEthernet0/0/1]port link-t
[sw1-GigabitEthernet0/0/1]port link-type ac
[sw1-GigabitEthernet0/0/1]port link-type access
[sw1-GigabitEthernet0/0/1]por
[sw1-GigabitEthernet0/0/1]port de
[sw1-GigabitEthernet0/0/1]port default v
[sw1-GigabitEthernet0/0/1]port default vlan 2
[sw1-GigabitEthernet0/0/2]po
[sw1-GigabitEthernet0/0/2]port l
[sw1-GigabitEthernet0/0/2]port link-t
[sw1-GigabitEthernet0/0/2]port link-type h
[sw1-GigabitEthernet0/0/2]port link-type hybrid
[sw1-GigabitEthernet0/0/2]port hybrid u
[sw1-GigabitEthernet0/0/2]port hybrid untagged v
[sw1-GigabitEthernet0/0/2]port hybrid untagged vlan 3 to 6
[sw1-GigabitEthernet0/0/2]po
[sw1-GigabitEthernet0/0/2]port h
[sw1-GigabitEthernet0/0/2]port hybrid p
[sw1-GigabitEthernet0/0/2]port hybrid pvid v
[sw1-GigabitEthernet0/0/2]port hybrid pvid vlan 3
[sw1-GigabitEthernet0/0/2]int g 0/0/3
[sw1-GigabitEthernet0/0/3]po
[sw1-GigabitEthernet0/0/3]port l
[sw1-GigabitEthernet0/0/3]port link-t
[sw1-GigabitEthernet0/0/3]port link-type t
[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 link-type hybrid
[sw1-GigabitEthernet0/0/4]port hybrid untagged vlan 3 4 5 6
[sw1-GigabitEthernet0/0/4]port hybrid tagged vlan 2
SW2:
[sw2]int g 0/0/2
[sw2-GigabitEthernet0/0/2]po
[sw2-GigabitEthernet0/0/2]port link-t
[sw2-GigabitEthernet0/0/2]port link-type a
[sw2-GigabitEthernet0/0/2]port link-type access
[sw2-GigabitEthernet0/0/2]po
[sw2-GigabitEthernet0/0/2]port de
[sw2-GigabitEthernet0/0/2]port default v
[sw2-GigabitEthernet0/0/2]port default vlan 2
[sw2-GigabitEthernet0/0/3]port link-t
[sw2-GigabitEthernet0/0/3]port link-type h
[sw2-GigabitEthernet0/0/3]port link-type hybrid
[sw2-GigabitEthernet0/0/3]po
[sw2-GigabitEthernet0/0/3]port h
[sw2-GigabitEthernet0/0/3]port hybrid u
[sw2-GigabitEthernet0/0/3]port hybrid untagged v
[sw2-GigabitEthernet0/0/3]port hybrid untagged vlan 3 to 6
[sw2-GigabitEthernet0/0/1]port link-t
[sw2-GigabitEthernet0/0/1]port link-type t
[sw2-GigabitEthernet0/0/1]port link-type trunk
[sw2-GigabitEthernet0/0/1]port trunk allow-pass
[sw2-GigabitEthernet0/0/1]port trunk allow-pass v
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 t 6
[sw2-GigabitEthernet0/0/4]port link-type t
[sw2-GigabitEthernet0/0/4]port link-type trunk
[sw2-GigabitEthernet0/0/4]port trunk allow-pass v
[sw2-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 t 6
SW3:
[sw3]int g 0/0/2
[sw3-GigabitEthernet0/0/2]p
[sw3-GigabitEthernet0/0/2]port l
[sw3-GigabitEthernet0/0/2]port link-t
[sw3-GigabitEthernet0/0/2]port link-type h
[sw3-GigabitEthernet0/0/2]port link-type hybrid
[sw3-GigabitEthernet0/0/2]p
[sw3-GigabitEthernet0/0/2]port h
[sw3-GigabitEthernet0/0/2]port hybrid p
[sw3-GigabitEthernet0/0/2]port hybrid pvid v
[sw3-GigabitEthernet0/0/2]port hybrid pvid vlan 5
[sw3-GigabitEthernet0/0/2]port hybrid untagged v
[sw3-GigabitEthernet0/0/2]port hybrid untagged vlan 3 4 5
[sw3-GigabitEthernet0/0/2]int g 0/0/3
[sw3-GigabitEthernet0/0/3]p
[sw3-GigabitEthernet0/0/3]port l
[sw3-GigabitEthernet0/0/3]port link-t
[sw3-GigabitEthernet0/0/3]port link-type h
[sw3-GigabitEthernet0/0/3]port link-type hybrid
[sw3-GigabitEthernet0/0/3]p
[sw3-GigabitEthernet0/0/3]port h
[sw3-GigabitEthernet0/0/3]port hybrid p
[sw3-GigabitEthernet0/0/3]port hybrid pvid v
[sw3-GigabitEthernet0/0/3]port hybrid pvid vlan 6
[sw3-GigabitEthernet0/0/3]port hybrid untagged vlan 3 4 6
[sw3-GigabitEthernet0/0/3]int g 0/0/1
[sw3-GigabitEthernet0/0/1]port link-type trunk
[sw3-GigabitEthernet0/0/1]p
[sw3-GigabitEthernet0/0/1]port t
[sw3-GigabitEthernet0/0/1]port trunk a
[sw3-GigabitEthernet0/0/1]port trunk allow-pass
[sw3-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 to 6
3.3 配置地址池
R1 物理接口1.0 子接口 2.0
[Huawei]sys r1
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip ad
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
Jul 24 2024 17:05:37-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 ad 192.168.2.1 24
[r1-GigabitEthernet0/0/0.1]do
[r1-GigabitEthernet0/0/0.1]dot1q t
[r1-GigabitEthernet0/0/0.1]dot1q termination
[r1-GigabitEthernet0/0/0.1]dot1q termination v
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[r1-GigabitEthernet0/0/0.1]
Jul 24 2024 17:06: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]a
[r1-GigabitEthernet0/0/0.1]arp b
[r1-GigabitEthernet0/0/0.1]arp broadcast e
[r1-GigabitEthernet0/0/0.1]arp broadcast enable
四、目标测试.
pc1 配置
4.1 pc1 ping pc2/pc4/pc5/pc6
4.2 pc2 能访问PC4/PC5/PC6
pc2 ip配置
4.3 pc4能访问 PC2/PC5,但不能访问PC6
pc4 ip配置