实验要求
1、PC1和PC3所在的接口为access;属于vlan2;
PC2/4/5/6处于同一网段;其中PC2可以访问PC4/5/6;但PC4可以访问PC5,不能访问PC6
2、PC5不能访问PC6
3、PC1/31与PC2/4/5/6不在同一个网段
4、且所有PC通过DHCP获取IP地址,且PC1/3可以正常访问PC2/4/5/6
将PC1、PC3划分在192.168.1.0 / 24中,PC2、PC4、PC5、PC6划分在192.168.2.0 / 24中
SW1
[sw1]vlan batch 2 to 6
[sw1]int g0/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 4 5 6
[sw1-GigabitEthernet0/0/2]int g0/0/3
[sw1-GigabitEthernet0/0/3]port link-type trunk
[sw1-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[sw1]int g 0/0/4
[sw1-GigabitEthernet0/0/4]port hybrid untagged vlan 3 4 5 6
[sw1-GigabitEthernet0/0/4]port hybrid tagged vlan 2
SW2
[sw2]vlan batch 2 to 6
[sw2]int g 0/0/3
[sw2-GigabitEthernet0/0/3]port link-type trunk
[sw2-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[sw2-GigabitEthernet0/0/3]int g0/0/1
[sw2-GigabitEthernet0/0/1]port link-type access
[sw2-GigabitEthernet0/0/1]port default vlan 2
[sw2-GigabitEthernet0/0/1]int g0/0/2
[sw2-GigabitEthernet0/0/2]port hybrid pvid vlan 4
[sw2-GigabitEthernet0/0/2]port hybrid untagged vlan 3 4 5
[sw2-GigabitEthernet0/0/2]int g0/0/4
[sw2-GigabitEthernet0/0/4]port link-type trunk
[sw2-GigabitEthernet0/0/4]port trunk allow-pass vlan all
SW3
[sw3]vlan batch 2 to 6
[sw3]int g0/0/3
[sw3-GigabitEthernet0/0/3]port link-type trunk
[sw3-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[sw3-GigabitEthernet0/0/3]int g 0/0/1
[sw3-GigabitEthernet0/0/1]port hybrid pvid vlan 5
[sw3-GigabitEthernet0/0/1]port hybrid untagged vlan 3 4 5
[sw3-GigabitEthernet0/0/1]int g 0/0/2
[sw3-GigabitEthernet0/0/2]port hybrid pvid vlan 6
[sw3-GigabitEthernet0/0/2]port hybrid untagged vlan 3 6
R1
R1
[R1]int g0/0/0.1
[R1-GigabitEthernet0/0/0.1]ip a 192.168.1.1 24
[R1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[R1-GigabitEthernet0/0/0.1]arp broadcast enable
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip a 192.168.2.1 24
[R1]dhcp enable
[R1]ip pool aa
[R1-ip-pool-aa]network 192.168.1.0 mask 24
[R1-ip-pool-aa]gateway-list 192.168.1.1
[R1-ip-pool-aa]dns-list 114.114.114.114
[R1]ip pool bb
[R1-ip-pool-bb]network 192.168.2.0 mask 24
[R1-ip-pool-bb]gateway-list 192.168.2.1
[R1-ip-pool-bb]dns-list 114.114.114.114
[R1]int g 0/0/0.1
[R1-GigabitEthernet0/0/0.1]dhcp select global
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]dhcp select global
PC6
PC5
PC1
PC4
PC2
PC3
2、PC2可以访问PC4、PC5、PC6;但PC4可以访问PC5,不能访问PC6
PC2pingPC4
PC2pingPC5
PC2pingPC6
PC4pingPC5
PC4pingPC6
3、PC5不能访问PC6
PC5pingPC6
4、PC1与PC3可以正常访问PC2、PC4、PC5、PC6
PC1pingPC2
PC1pingPC4
PC1pingPC5
PC1pingPC6
PC3pingPC2
PC3pingPC4
PC3pingPC5
PC3pingPC6