实现不同vlan间通信的两种方法,一文了解清楚交换机的通信
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">昨天我们提到1000路大型网络监控如何分配ip地址?, 有朋友问到,vlan间需要什么才能通信呢?如何让不同vlan之间通信,我们通常提到了,vlan间通信需要三层交换机,那么不用三层交换机能不能通信呢?其实不同VLAN之间相互通信的两种方式,单臂路由、三层交换机,它们分别如何配置呢?哪一种好呢?seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">今天我们来看下,这两种方式是如何来实现vlan间的通信。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">本篇文章要从三个问题开始说起?
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">1、实现vlan间的通信有哪些方式?
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">2、它们如何实现?如何配置?
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">3、它们有什么不同之处?哪一种好?
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">一、实现不同vlan间的通信有哪些?
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">我们知道要实现不同vlan间通信,就必须需要有路由功能,单臂路由的实现方式,其实就是普通二层交换机加路由器,从而实现不同vlan间的可以互相通信。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">那为什么三层交换机不用路由器?因为三层交换机本身有路由功能,所以不用其它路由就可以实现vlan间的通信。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">因此:
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">不 同VLAN之间相互通信的两种方式(单臂路由、三层交换机),我们来看下他们的组网拓扑图,对网络有了解的朋友,就能看出他们的区别。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">1、通过单臂路由实现不同VLAN之间的通信,如下图:
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
http://p1.pstatp.com/large/pgc-image/4e544e2f0f3844ecacac1f629ee4afdb
seline; word-break: break-word; max-width: 100%; display: block; border-radius: 4px;"/>seline; word-break: break-word;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">2、通过三层交换路由功能实现不同VLAN之间的通信: 如下图
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
http://p1.pstatp.com/large/pgc-image/e29774e80dcf4c1d8d5888ffe092413a
seline; word-break: break-word; max-width: 100%; display: block; border-radius: 4px;"/>seline; word-break: break-word;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">当然看这两个拓扑图很多朋友可能不是很清楚,那么下面我们来通过交换机配置来详细了解,如何用两种方式分别实现不同vlan间通信。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">二、单臂路由实现不同vlan互通
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">拓扑图如下:
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
http://p1.pstatp.com/large/pgc-image/4e544e2f0f3844ecacac1f629ee4afdb
seline; word-break: break-word; max-width: 100%; display: block; border-radius: 4px;"/>seline; word-break: break-word;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">上面说了,单臂路由组网是由普通交换机与路由器组成,所以我们在配置时,要配置交换机与路由。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">1、 交换机SW3的具体配置(主要配置vlan和trunk接口)
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第一步: 在SW3上创建vlan100、vlan200、vlan300,名称依次为caiwu、xiaoshou、gongcheng。(创建vlan既可以在vlandatabase中,也可以在全局模式下配置,本实验是在vlan database中配置的)。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
http://p3.pstatp.com/large/pgc-image/211bf76096ac47d7b8806b1bf7c35b4e
seline; word-break: break-word; max-width: 100%; display: block; border-radius: 4px;"/>seline; word-break: break-word;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第二步: 在全局模式下,
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">将f0/1 – 5号端口划分到vlan 100中,
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">f0/6– 10口划分到vlan 200中,
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">f0/11 – 15号端口划分到vlan 300中,
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">并全部配置成access模式。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
http://p9.pstatp.com/large/pgc-image/e52c4884f4e94768b05e2bb115abc7c9
seline; word-break: break-word; max-width: 100%; display: block; border-radius: 4px;"/>seline; word-break: break-word;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第三步: 使用show vlan显示SW3的vlan配置信息,可以看出配置正确)
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
http://p1.pstatp.com/large/pgc-image/87e40cd650f14bcc8f09a0b1b1621a88
seline; word-break: break-word; max-width: 100%; display: block; border-radius: 4px;"/>seline; word-break: break-word;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第四步: 交换机如果通过路由器实现VLAN之间的通信,需要将连接交换机的端口配置成trunk模式,只有trunk线路才能使vlan通过。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
http://p1.pstatp.com/large/pgc-image/c7859f425d7f44d7b0e7cc169cdf1723
seline; word-break: break-word; max-width: 100%; display: block; border-radius: 4px;"/>seline; word-break: break-word;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">2、 路由器R2的具体配置(通过配置路由器子接口封装之后作为每一个vlan的网关)
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第一步:在路由器(R2)与交换机(SW3)的端口上配置子接口,每个子接口的IP地址是每个VLAN的网关地址(也可以理解为下一跳地址),并在子接口上封装802.1Q协议(交换机通用封装模式,用命令encapsulation dot1q 封装),如下所示:
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
http://p3.pstatp.com/large/pgc-image/4b1b2f931f6448108d646f496c593a9d
seline; word-break: break-word; max-width: 100%; display: block; border-radius: 4px;"/>seline; word-break: break-word;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第二步: 将PC5和PC6分别连接到交换机SW3的f0/6和f0/1上,然后配置PC5的IP地址为192.168.2.1/24,网关为192.168.2.254。PC6的IP地址为192.168.1.1,网关为192.168.1.254。然后用PC5 ping PC6,看是否能ping通。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
http://p3.pstatp.com/large/pgc-image/fef53f26dc284380bcb41e279f3a3d8f
seline; word-break: break-word; max-width: 100%; display: block; border-radius: 4px;"/>seline; word-break: break-word;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">pc5与pc6处于不同的vlan,如上所示,他们已能够互通,所以不同vlan间已实现互通。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">三、三层交换机实现不同vlan间互通
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">三层交换机的配置我们前面曾多次提到,例子有很多,这里面我们就举个稍显复杂些的例子来举例了,这也是项目中经常会遇到的典型案例。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">拓扑图如下:
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
http://p1.pstatp.com/large/pgc-image/ec225eaac74f464f88802cd397afde5b
seline; word-break: break-word; max-width: 100%; display: block; border-radius: 4px;"/>seline; word-break: break-word;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">为了让大家能够更详细的看到代码的注释,我们就不截图,直接发配置代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">一、【实验目的】
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">1、同一VLAN里的计算机系统能跨交换机相互通信。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">2、不同VLAN里的计算机系统也可以相互通信。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">3、各vlan信息如下:
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">vlan10: 192.168.10.1/24
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">vlan20: 192.168.20.1/24
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">vlan30: 192.168.30.1/24
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">4、各pc ip地址及网关如下:
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">pc机 ip地址 网关
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">pc1 192.168.10.2/24 192.168.10.1
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">pc2 192.168.20.2/24 192.168.20.1
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">pc3 192.168.10.3/24 192.168.10.1
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">pc4 192.168.20.3/24 192.168.20.1
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">pc5 192.168.30.2/24 192.168.30.1
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">pc6 192.168.20.4/24 192.168.20.1
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">pc7 192.168.30.3/24 192.168.30.1
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">二、【配置步骤】
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">1、交换机s0的配置如下:
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch> en //进入特权模式
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch#conf t //进入配置模式
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#vlan 10 //创建vlan10
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-vlan)#vlan 20 //创建vlan20
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Enter configuration commands, one perline. End with CNTL/Z.
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#int fa0/2 //进入端口0/2
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#switchport access vlan 10 //把端口 0/2划分给vlan10
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#exit //退出 端口0/2
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#int fa0/3 //进入端口0/3
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#switchport access vlan 20 //把端口0/3划分给vlan20
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#exit //退出端口0/3
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#int fa0/1 //进入端口0/1
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#switchport mode trunk //端口模式为trunk
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">小结:把交换机S0的下面的端口各pc分配各自的vlan,然后把fa0/1口设为trunk,因为交换机之间设置了trunk接口,使得不同vlan之间能够通过其他的交换机!
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">2、交换机s1的配置如下:
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch>en
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch#conf t
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Enter configuration commands, one perline. End with CNTL/Z.
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#vlan 10
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-vlan)#exit
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#vlan 20
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-vlan)#vlan 30
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-vlan)#exit
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#int f0/2
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#switchport access vlan 10
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#exit
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#int f0/3
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#switchport access vlan 20
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#exit
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#int f0/4
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#switchport access vlan 30
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#exit
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#int f0/1
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#switchport mode trunk //端口模式为trunk
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">交换机s1的配置如s0的基本差不多,代码都一样。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">3、交换机s2的配置如下:
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch>en
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch#conf t
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Enter configuration commands, one perline. End with CNTL/Z.
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#vlan 20
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-vlan)#vlan 30
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-vlan)#exit
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#int fa0/2
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#switchport access vlan 20
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#exit
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#int fa0/3
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#switchport access vlan 30
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#exit
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#int fa0/1
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#switchport mode trunk
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">交换机s2的配置如s0、s1的基础差不多,把相应的端口划分到相应的vlan中,没有出现什么新代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">4、三层交换机3560的配置如下:
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch>en //进入特权模式
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch#conf t //进入配置模式
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#vlan 10 //创建vlan10
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-vlan)#vlan 20 //创建vlan20
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-vlan)#vlan 30 //创建vlan10
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-vlan)#exit //返回上一级
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#int vlan 10 //进入vlan10
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#ip address 192.168.10.1 255.255.255.0 //给vlan 10添加ip地址及子网掩码
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#no shutdown //开启端口
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#exit //退回 上一极
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#int vlan 20 //进入vlan20
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#ip address 192.168.20.1 255.255.255.0 //给vlan 20添加ip地址及子网掩码
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#no shutdown //开启端口
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#exit //退回上一级
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#int vlan 30 //进入vlan30
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#ip address 192.168.30.1 255.255.255.0 //给vlan 20添加ip地址及子网掩码
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#no shutdown //开启端口
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if)#exit //返回上一级
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config)#int range fa0/2-4 //进入2-4端口
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch(config-if-range)#switchport mode trunk //端口模式为trunk
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">Switch#show ip route //显示ip路由
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">那么这样就配置完成了。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">三、总结
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">从试验过程中可以看出实现不同VLAN之间的两种方式,一个是通过单臂路由实现,另一个是通过三层交换的路由功能实现的,可以说不同VLAN之间的通信必须通过路由功能才能实现通信。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">其次,不同网段之间都需要配置下一跳地址(网关)才能通信。那么什么时候用单臂路由,什么时候选择三层交换呢。单臂路由是不具有扩展性的,为什么这么说呢,如果VLAN的数量不断增加,流经路由器与交换机之间链路的流量也变得非常大,这时,这条链路也就成为了整个网络的瓶颈,即使你网络的带宽再快,也是如此。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">因此,当网络不断增大,划分的VLAN不断增多的时候,就需要配置三层交换机的路由功能,实现不同VLAN之间的通信(三层交换机的数据表的吞吐量通常为数百万pps,而传统路由器的吞吐量只有10kpps~1Mpps,其次三层交换机是通过硬件来交换和路由选择数据包的,吞吐量当然大了,甚至接近于线速。而路由器只是通过虚拟子接口来交换和路由选择数据包的,不是硬件实施的,吞吐量也就变的小了。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">总之一句话:三层交换技术在第三层实现了数据包的高速转发,从而解决了传统路由器低速、负责所造成的网络瓶颈问题。
页:
[1]