江苏省吴江市双板桥路3号兴源网络

0512-63028342

ly@wjxy.net.cn

两个三层交换机不同VLAN间的互通

三层交换机SW1:

VLANIF100:192.168.100.1

VLANIF110:192.168.110.1

VLANIF120:192.168.120.1

三层交换机SW2:

VLANIF100:192.168.100.2

VLANIF130:192.168.110.1

VLANIF140:192.168.120.1

拓扑:

SW1配置:

[sw1]vlan batch 100 110 120
[sw1]interface vlanif 100
[sw1]ip address 192.168.100.1 255.255.255.0
[sw1]q
[sw1]interface vlanif 110
[sw1]ip address 192.168.110.1 255.255.255.0
[sw1]dhcp select global
[sw1]q
[sw1]interface vlanif 120
[sw1]ip address 192.168.120.1 255.255.255.0
[sw1]dhcp select global
[sw1]q
这里忽略设置IP pool和dhcp
[sw1]interface GigabiteEthernet 0/0/1
[sw1]port link-type access
[sw1]port default vlan 110
[sw1]q
[sw1]interface GigabiteEthernet 0/0/2
[sw1]port link-type access
[sw1]port default vlan 120
[sw1]q
[sw1]interface GigabiteEthernet 0/0/48
[sw1]port link-type trunk
[sw1]port trun allow-pass 100 110 120 130 140
[sw1]q
[sw1]ip route-static 192.168.130.0 255.255.255.0 192.168.100.2 ///这里网关指定为sw2地址
[sw1]ip route-static 192.168.140.0 255.255.255.0 192.168.100.2 ///这里网关指定为sw2地址
[sw1]

SW2配置:
[sw1]vlan batch 100 130 140
[sw1]interface vlanif 100
[sw1]ip address 192.168.100.2 255.255.255.0
[sw1]q
[sw1]interface vlanif 130
[sw1]ip address 192.168.130.1 255.255.255.0
[sw1]dhcp select global
[sw1]q
[sw1]interface vlanif 140
[sw1]ip address 192.168.140.1 255.255.255.0
[sw1]dhcp select global
[sw1]q
这里忽略设置IP pool和dhcp
[sw1]interface GigabiteEthernet 0/0/1
[sw1]port link-type access
[sw1]port default vlan 130
[sw1]q
[sw1]interface GigabiteEthernet 0/0/2
[sw1]port link-type access
[sw1]port default vlan 140
[sw1]q
[sw1]interface GigabiteEthernet 0/0/48
[sw1]port link-type trunk
[sw1]port trun allow-pass 100 110 120 130 140
[sw1]q
[sw1]ip route-static 192.168.110.0 255.255.255.0 192.168.100.1 ///这里网关指定为sw2地址
[sw1]ip route-static 192.168.120.0 255.255.255.0 192.168.100.1 ///这里网关指定为sw2地址
[sw1]

发表评论

邮箱地址不会被公开。 必填项已用*标注