小白网-奉贤部落-奉贤免费信息发布平台

查看: 75|回复: 0

实现分歧vlan间通讯的两种方式,一文领会清楚交换机的通讯

[复制链接]

2万

主题

0

回帖

8万

积分

论坛元老

Rank: 8Rank: 8

积分
88256
发表于 2025-7-26 14:03 | 显示全部楼层 |阅读模式
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;">
小白网-实现分歧vlan间通讯的两种方式,一文领会清楚交换机的通讯(1)
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;">
小白网-实现分歧vlan间通讯的两种方式,一文领会清楚交换机的通讯(2)
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;">
小白网-实现分歧vlan间通讯的两种方式,一文领会清楚交换机的通讯(3)
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;">
小白网-实现分歧vlan间通讯的两种方式,一文领会清楚交换机的通讯(4)
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;">
小白网-实现分歧vlan间通讯的两种方式,一文领会清楚交换机的通讯(5)
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;">
小白网-实现分歧vlan间通讯的两种方式,一文领会清楚交换机的通讯(6)
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;">
小白网-实现分歧vlan间通讯的两种方式,一文领会清楚交换机的通讯(7)
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;">
小白网-实现分歧vlan间通讯的两种方式,一文领会清楚交换机的通讯(8)
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;">
小白网-实现分歧vlan间通讯的两种方式,一文领会清楚交换机的通讯(9)
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;">
小白网-实现分歧vlan间通讯的两种方式,一文领会清楚交换机的通讯(10)
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;">总之一句话:三层交换技术在第三层实现了数据包的高速转发,从而处理了传统路由器低速、负责所酿成的收集瓶颈题目他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|小白网-奉贤部落-奉贤免费信息发布平台  

GMT+8, 2025-11-8 22:26 , Processed in 0.339079 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表