交换基础实验
实验要求
①所有PC均以DHCP自动获取IP地址
②PC1和PC3所在接口模式为Access,且PVID为VLAN 2
③PC2、PC4、PC5、PC6处于同一网段,PC1、PC2与它们不在同一网段
④PC1、PC2、PC3可以访问PC4、PC5、PC6;PC4可以访问PC5;PC4、PC5不能访问PC6
实验拓扑
具体配置
VLAN配置
【SW1】
vlan batch 2 to 5
int e0/0/1
port link-type access
port default vlan 2
int e0/0/2
port hybrid pvid vlan 3
port hybrid untagged vlan 3 to 5
int e0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 5
int g0/0/1
port hybrid tagged vlan 2
port hybrid untagged vlan 3 to 5
【SW2】
vlan batch 2 to 5
int e0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 5
int e0/0/1
port link-type access
port default vlan 2
int e0/0/2
port hybrid pvid vlan 4
port hybrid untagged vlan 3 4
int e0/0/4
port hybrid untagged vlan 3 to 5
【SW3】
vlan batch 3 to 5
int e0/0/3
port hybrid tagged vlan 3 to 5
int e0/0/1
port hybrid pvid vlan 4
port hybrid untagged vlan 3 4
int e0/0/2
port hybrid pvid vlan 5
port hybrid untagged vlan 3 5
【R1】
int e0/0/1
ip ad 192.168.1.1 24
int e0/0/1.1
ip ad 192.168.2.1 24
dot1q termination vid 2
arp broadcast enable
DHCP配置
【R1】
dhcp enable
ip pool a
network 192.168.1.0 mask 24
gateway-list 192.168.1.1
dns-list 114.114.114.114 8.8.8.8
q
ip pool b
network 192.168.2.0 mask 24
gateway-list 192.168.2.1
dns-list 114.114.114.114 8.8.8.8
int e0/0/1
dhcp select global
int e0/0/1.1
dhcp select global
结果测试
开启所有PC的DHCP
开始ping测试:
PC1可访问PC3/4/5/6
PC2可访问PC4/5/6
PC3可访问PC4/5/6
PC4可访问PC5,不能访问PC6 //部分忽略
完成要求!