cisco Switching-三层交换vlan间通信

问题

VLAN实现了广播域的隔离,同时也将VLAN间的通信隔离了。三层交换技术使得VLAN间可以通信。

方案

为了解决了传统路由器低速、复杂所造成的网络瓶颈问题,引入了三层交换技术。它根据实际应用时的情况,灵活地在网络第二层或者第三层进行网络分段。具有三层交换功能的设备是一个带有第三层路由功能的第二层交换机。

简单地说,三层交换技术就是:二层交换技术+三层转发技术。

拓扑图

步骤

在连接PC的交换机上划分3个VLAN,并按拓扑图把PC机加入相应VLAN

tarenasw-3L (config)#vlan 2 //vlan1是默认VLAN,不需创建

tarenasw-3L (config-vlan)# exit

tarenasw-3L (config)# vlan 3

tarenasw-3L (config-vlan)#exit

tarenasw-3L (config)#interface f0/1

tarenasw-3L (config-if)#switchport mode access

tarenasw-3L (config-if)#switchport access vlan 1

tarenasw-3L (config-if)#interface f0/2

tarenasw-3L (config-if)#switchport mode access

tarenasw-3L (config-if)#switchport access vlan 2

tarenasw-3L (config-if)#interface f0/3

tarenasw-3L (config-if)#switchport mode access

tarenasw-3L (config-if)#switchport access vlan 3

查看划分完的VLAN信息

tarenasw-2L#show vlan

VLAN Name Status Ports

---- ----------------------- --------- ---------------------

1 default active Fa0/1, Fa0/4, Fa0/5, Fa0/6

Fa0/7, Fa0/8, Fa0/9, Fa0/10

Fa0/11, Fa0/12, Fa0/13, Fa0/14

Fa0/15, Fa0/16, Fa0/17, Fa0/18

Fa0/19, Fa0/20, Fa0/21, Fa0/22

Fa0/23, Fa0/24, Gig1/1, Gig1/2

2 vlan0002 active Fa0/2

3 vlan0003 active Fa0/3

为vlan1、vlan2、vlan3分别设置管理IP并开启三层交换机路由功能

tarenasw-3L #enable

tarenasw-3L #configure terminal

tarenasw-3L (config)#ip routing //开启三层交换机路由功能

tarenasw-3L (config)#interface vlan 1

tarenasw-3L (config-if)#ip address 192.168.1.254 255.255.255.0

tarenasw-3L (config-if)#no shutdown

tarenasw-3L (config-if)#exit

tarenasw-3L (config)#interface vlan 2

tarenasw-3L (config-if)#ip address 192.168.2.254 255.255.255.0

tarenasw-3L (config-if)#no shutdown

tarenasw-3L (config-if)#exit

tarenasw-3L (config)#interface vlan 3

tarenasw-3L (config-if)#ip address 192.168.3.254 255.255.255.0

tarenasw-3L (config-if)#no shutdown

给客户端配置IP地址并测试网络连通性

配置pc

在PC1上测试网络连通性

PC1>ping 192.168.3.1

Pinging 192.168.3.1 with 32 bytes of data:

Reply from 192.168.3.1: bytes=32 time=11ms TTL=128

Reply from 192.168.3.1: bytes=32 time=1ms TTL=128

Reply from 192.168.3.1: bytes=32 time=1ms TTL=128

Reply from 192.168.3.1: bytes=32 time=4ms TTL=128

Ping statistics for 192.168.3.1:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 1ms, Maximum = 11ms, Average = 4ms

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值