通过VLAN Switch实现,报文转发效率高且安全性较强。
PC1属于VLAN10,PC2属于VLAN20;
B配置:
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface Ethernet0/0/2
port link-type access
port default vlan 10
#
C配置:
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 20
#
interface Ethernet0/0/2
port link-type access
port default vlan 20
#
A配置:
#
interface GigabitEthernet0/0/1
port link-type trunk
#
interface GigabitEthernet0/0/2
port link-type trunk
#
vlan-switch name1 interface GigabitEthernet 0/0/1 vlan 10 interface
GigabitEthernet 0/0/2 switch-vlan 20
#
VLAN10 和VLAN20内的PC可以互相访问,VLAN10、VLAN20不能是Switch A已经创建的全局VLAN,否则无法配置VLAN Switch。