Advertisement

ENSP实验三——跨交换机配置VLAN

阅读量:

一、设备清单及目标

1,设备

4台PC,2台交换机S5700

2,目标

不同交换机下同一VLAN的PC互通,通过添加静态路由使不同VLAN之间的PC互通。

二、拓扑图

三、配置

1,PC

PC1:IP/掩码192.168.10.1/24,GW192.168.10.254

PC2:IP/掩码192.168.20.1/24,GW192.168.20.254

PC3:IP/掩码192.168.10.3/24,GW192.168.10.254

PC4:IP/掩码192.168.20.4/24,GW192.168.20.254

2,交换机

SW1:

sy

sy sw1

vlan batch 10 20 //创建VLAN10和20

int g0/0/2

port link-type access //设置端口模式为access

port default vlan 10 //将此端口加入VLAN 10

int g0/0/3

port link-type access

port default vlan 20

int g0/0/1

port link-type trunk //设置端口模式为trunk

port trunk allow-pass vlan all //允许所有VLAN数据通过此端口

int vlan 10 //进入VLAN 10

ip add 192.168.10.254 24 //进入VLAN 10并添加地址,设为端口所连VLAN地址的网关地址

int vlan 20

ip add 192.168.20.254 24

ip route-static 0.0.0.0 0 g0/0/1 //添加一条默认路由

ip route-static 192.168.20.1 24 g0/0/3 //添加静态路由

ip route-static 192.168.10.1 24 g0/0/2

SW2:

sy

sy sw2

vlan batch 10 20

int g0/0/2

port link-type access

port default vlan 10

int g0/0/3

port link-type access

port default vlan 20

int g0/0/1

port link-type trunk

port trunk allow-pass vlan all

int vlan 10

ip add 192.168.10.254 24

int vlan 20

ip add 192.168.20.254 24

ip route-static 0.0.0.0 0 g0/0/1

ip route-static 192.168.10.3 24 g0/0/2

ip route-static 192.168.20.4 24 g0/0/3

四、实验结果

同VLAN和不同VLAN的PC都能互相ping通。

五、注意事项。

无。

全部评论 (0)

还没有任何评论哟~