通过三层交换机使不同的Vlan能连通
最后配置形成的拓扑图
SW1
system-view
sysname SW1
vlan batch 10 20
interface Vlanif 10
ip address 192.168.1.254 24
interface Vlanif 20
ip address 192.168.2.254 24
interface GigabitEthernet 0/0/1
port link-type trunk
port trunk allow-pass vlan all
quit
SW2
system-view
sysname SW2
vlan batch 10 20
interface GigabitEthernet 0/0/1
port link-type trunk
port trunk allow-pass vlan all
interface GigabitEthernet 0/0/2
port link-type access
port default vlan 10
interface GigabitEthernet 0/0/3
port link-type access
port default vlan 20
Quit
运行命令截图