拓扑图
pc1配置:
pc2配置:
pc3配置:
pc4配置:
switch1配置:
(1)划分vlan
sys
sysname sw1
vlan batch 10 20
(2)配置接口:
interface Ethernet0/0/1
port link-type access
port default vlan 10
interface Ethernet0/0/2
port link-type access
port default vlan 20
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
switch2配置:
(1)划分vlan
sys
sysname sw1
vlan batch 10 20
(2)配置接口:
interface Ethernet0/0/1
port link-type access
port default vlan 10
interface Ethernet0/0/2
port link-type access
port default vlan 20
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
结果验证:
pc1与pc3正常通信,与pc2不能通信