配置Vlan

先把每个主机上配置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
posted @ 2019-11-17 23:24  x_sh  阅读(147)  评论(0)    收藏  举报