拓扑:
搭建步骤:
1 在sw1 和sw3上创建vlan , 并将与主机相连的接口设为access并分到相应vlan上
SW1:
sysname SW1
vlan batch 10 20
interface GigabitEthernet0/0/10
port link-type access
port default vlan 10
interface GigabitEthernet0/0/20
port link-type access
port default vlan 20
SW3:
sysname SW3
vlan batch 10
interface GigabitEthernet0/0/10
port link-type access
port default vlan 10
将两个交换机的vlan出口的接口设为trunk,并允许所有vlan进出
SW1:
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
SW3:
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
重点:三层交换机上 做配置
Sw2:
sysname SW2
vlan batch 10 20
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface Vlanif10
ip address 192.168.1.1 255.255.255.0
interface Vlanif20
ip address 10.224.9.1 255.255.255.0
测试:
原文地址:http://blog.51cto.com/wskang/2120891