用两台交换机,第一台交换机接4台主机,主机1、2接vlan 10,主机3、4接 vlan 20,第二台交换机接两台主机,主机5接vlan 10,主机6接vlan 20,使同个vlan 的主机能互通。
PC端配置:配置ip地址。
交换机配置:
1、第一台交换机:
1)创建vlan
system-view
vlan 10
vlan 20
quit
2)配置PC端接口
interface range gi 1/0/1 to gi 1/0/2
port link-type access
port access vlan 10
quit
interface range gi 1/0/3 to gi 1/0/4
port link-type access
port access vlan 20
quit
3)配置级联口
interface gi 1/0/48
port link-type trunk
port trunk permit vlan 10 20
1、第二台交换机:
1)创建vlan
system-view
vlan 10
vlan 20
quit
2)配置PC端接口
interface gi 1/0/1
port link-type access
port access vlan 10
quit
interface gi 1/0/2
port link-type access
port access vlan 20
quit
3)配置级联口
interface gi 1/0/48
port link-type trunk
port trunk permit vlan 10 20