先把每个主机上配置ip地址和掩码地址,然后在交换机上创建vlan 10和vlan 20,之后用interface 进入接口
把主机1和2配置为vlan10,主机3和4配置为vlan20。之后在交换机r2上创建vlan 10和vlan 20,之后用interface 进入接口
把主机1配置为vlan10,主机2配置为vlan20。之后再把两个交换机都用trunk模式。
system-view
vlan batch 10 20
interface Ethernet 0/0/1
port link-type access
port default vlan 10
interface Ethernet 0/0/2
port link-type access
port default vlan 10
interface Ethernet 0/0/3
port link-type access
port default vlan 20
interface Ethernet 0/0/4
port link-type access
port default vlan 20
quit
system-view
interface GigabitEthernet 0/0/2
port link-type trunk
port trunk allow-pass vlan10 20
配置Vlan
原文:https://www.cnblogs.com/XieShuoHan/p/11879231.html