虚拟局域网组网技术.ppt

上传人:本田雅阁 文档编号:3306748 上传时间:2019-08-10 格式:PPT 页数:40 大小:695.54KB
返回 下载 相关 举报
虚拟局域网组网技术.ppt_第1页
第1页 / 共40页
虚拟局域网组网技术.ppt_第2页
第2页 / 共40页
虚拟局域网组网技术.ppt_第3页
第3页 / 共40页
虚拟局域网组网技术.ppt_第4页
第4页 / 共40页
虚拟局域网组网技术.ppt_第5页
第5页 / 共40页
点击查看更多>>
资源描述

《虚拟局域网组网技术.ppt》由会员分享,可在线阅读,更多相关《虚拟局域网组网技术.ppt(40页珍藏版)》请在三一文库上搜索。

1、虚拟局域网 组网技术,VLAN的应用背景及实现功能,【背景描述】 某企业有两个主要部门:技术部和销售部,其中销售部门的个人计算机系统分散连接,也就有一名销售部的工作人员在技术部的办公室,他的电脑连接在技术部的交换机上。技术部之间、销售部之间需要相互进行通信,但为了数据安全起见,技术部和销售部需要进行相互隔离。 【拓扑图如下:】,技术需求,同一个部门的主机在同一个局域网上,并且部门内的数据流量不希望其他部门收到,也不希望干扰其他部门,也就是要求同一个部门在同一个“广播域”上。 显然对于以上的物理拓扑,所有主机通过交换机相连,处在同一个广播域(没有划分VLAN的交换机上的各个端口上的设备分别属于不

2、同的冲突域,每一交换端口构成一个冲突域,但同属于一个广播域)。如A1和A3之间的广播,A2、B1、B2也会收到,这不是我们所希望的。,不加限制,会产生广播风暴问题,广播,需求导致了VLAN的产生,需要有一种办法,在尽量不改动网络固有配置的前提下,通过灵活的、标准的、基于软件的做法将具有相同需求的用户放到一起,使之就象在一个LAN中那样工作。 它不但能够在物理上使网络延伸,还能使对网络实施更灵活强大的控制功能成为可能。 VLAN的出现使之成为可能。,VLAN简介,冲突域和广播域 交换机能隔离冲突域,但不能隔离广播域,通过多个交换机连接在一起的所有计算机都在一个广播域中,任何一台计算机发送的广播包

3、,其他计算机都会收到,这样大大降低了带宽的利用率。 VLAN(Virtual LAN)可以隔离广播域,VLAN工作在OSI模型的第2层,是交换机端口的逻辑组合。 VLAN的主要优点 广播风暴防范 安全 性能提高 提高管理效率,VLAN的划分,基于端口的VLAN 在这种定义方法中,某个交换机上的端口(例如端口1、3、5)构成VLAN A,而该交换机上的其他端口构成VLAN B。早期基于端口的VLAN成员只能位于一个交换机中。第二代基于端口的VLAN支持多个交换机,例如交换机X上的端口1和端口2与交换机Y上的端口3和端口4构成一个VLAN。 基于MAC地址的VLAN 在这种定义方法中,若干个MAC

4、地址构成VLAN成员。用户属于哪个VLAN由其网卡中的MAC地址决定。,Trunk简介,VLAN可以把在同一个交换机上端口组合成一个VLAN,也可以不同交换机上的端口组合成一个VLAN。当一个VLAN跨过不同的交换机时,在同一个VLAN上但是接在不同的交换机上的计算机如何实现通信?,VLAN 2,VLAN 1,VLAN 1,VLAN 2,VLAN标记技术,直观的方法是为每一个VLAN增加连线,这样多个VLAN会占用太多接口。 可以采用Trunk技术实现跨交换机的VLAN内通信,Trunk技术使得在一条物理线路上可以传递多个VLAN的信息。 为了区别多个VLAN的数据帧,需要某种标记技术。有两种

5、常见的Trunk帧标记技术:ISL和IEEE 802.1Q。 ISL技术在原有的帧上重新加了一个帧头,并重新生产了帧校验序列(FCS)。ISL是思科特有的技术。 IEEE 802.1Q技术是在原有帧的源MAC地址字段后插入4字节的标记字段,同时用心的CRC字段替代了原有的CRC字段。IEEE 802.1Q是国际标准。,采用ISL的Trunk,使用ASIC执行 对计算机透明,计算机看不到ISL头部 可以在交换机与交换机之间、交换机与路由器之间使用,ISL帧格式,封装技术(Encapsulated) 协议无关的(Protocol independent) 将原有的帧封装在新的帧中,采用802.1Q

6、的Trunk,802.1Q帧格式,标记技术(Tagged) 协议相关的(Protocol dependent) 在原有帧中添加一个字段,采用Trunk技术实现了VLAN的跨计算机通信,VLAN 2,VLAN 1,VLAN 1,VLAN 2,带有VLAN 1标签的以太网帧,带有VLAN 2标签的以太网帧,不带VLAN标签的 以太网帧,DTP(Dynamic Trunk Protocol)简介,管理员可以手动指定交换机之间的链路是否形成Trunk,也可以让交换机自动协商,这个协议称为DTP,DTP还可以协商Trunk链路的封装类型。 配置了DTP的交换机会发送DTP协商包,或者对对方发送来的DTP

7、包进行响应,双方最终商讨他们之间的链路是否形成Trunk,以及采用什么样的Trunk封装方式。 Cisco网络设备支持动态协商端口的工作状态。 根据动态协议的实现方式,Cisco网络设备接口有多种不同的工作模式。,交换机接口模式,cisco网络中,交换机在局域网中最终稳定状态的接口类型主要有四种:access / trunk / multi / dot1q-tunnel。 1、access: 主要用来接入终端设备,如PC机、服务器、打印服务器等。 2、trunk: 主要用在连接其它交换机,以便在线路上承载多个VLAN。 3、multi: 在一个线路中承载多个vlan,但不像trunk,它不对承

8、载的数据打标签。主要用于接入支持多vlan的服务器或者一些网络分析设备。现在基本不使用此类接口,在Cisco的网络设备中,也基本不支持此类接口了。 4、dot1q-tunnel: 用在Q-in-Q隧道配置中。,Cisco交换机接口模式的设置,1、switchport mode access:强制接口成为access接口,并且可以与对方主动进行协商,诱使对方成为access模式。 2、switchport mode trunk:强制接口成为trunk接口,并且主动诱使对方成为trunk模式,所以当邻居交换机接口为trunk/desirable/auto时会成为Trunk接口。 3、switchp

9、ort mode dynamic desirable:主动协商建立trunk,发送并接收DTP信号。如果邻居交换机模式为trunk/desirable/auto之一,则接口将变成trunk接口。如果不能形成trunk模式,则工作在access模式。 4、switchport mode dynamic auto:被动协商建立trunk,只接收不发送DTP信号。当邻居接口为trunk/desirable之一时,才会成为trunk。如果不能形成trunk模式,则工作在access模式。 5、switchport nonegotiate:严格的说,这不算是种接口模式,它的作用只是阻止交换机接口发出DT

10、P数据包,它必须与switchport mode trunk或者switchport mode access一起使用。 6、switchport mode dot1q-tunnel:配置交换机接口为隧道接口(非trunk),以便与用户交换机的trunk接口形成不对称链路。,VLAN实验,【实验目的】 了解VLAN交换机的特性与应用场合 掌握VLAN交换机组网的基本配置方法 【实验环境】:模拟软件 Cisco Packet Tracer 5.2 Packet Tracer是思科公司为网络学员认证学习而开发的一套用来设计、配置和排除故障的网络模拟系统,目前最新版本为5.2。 该软件支持大量的设备仿

11、真模型:路由器、交换机、无线网络设备、服务器、各种连接电缆、终端等,还能仿真各种模块,这在实际实验设备中是无法配置齐全的。 对设备均提供图型化和终端两种配置方法,各设备模型均有可视化的外观仿真。,VLAN实验内容,实验器材:3560交换机2台,PC机5台,连接线若干。 网络拓扑图如下: 图中:A1、A2、A3连接在Switch1上,B1、B2连接在Switch2上。 假定应用场景是A1、A3属于技术部,B1、B2、A2属于销售部,要求同一部门的主机在同一个局域网上。,VLAN实验内容,交换机端口连接配置,主机IP地址配置,配置各台主机,配置主机IP地址 点击 主机 图标,在弹出的窗口中,点击“

12、Desktop”选项卡,在“IP Configuration”里直接配置IP地址和子网掩码。 或者在“Command Prompt”里,输入命令 ipconfig ip_addr net_mask 配置完主机IP地址,回答【问题1】: 每台主机相互ping,查看哪些主机可以连通,哪些不可以?为什么? 注:可以用 ping -n 1 255.255.255.255 发起一个受限广播,(参数 -n 1指明只发送一次,免得默认发送4次受到干扰),观察都收到了哪些主机的回复?,在交换机上配置VLAN,VLAN配置如下:,点击 交换机 图标,在弹出的窗口中,点击“CLI”,进入交换机配置终端。,在Swi

13、tch上创建VLAN,在Switch1上创建VLAN 进入特权模式: Switchenable 进入VLAN配置模式: Switch#vlan database Switch(vlan)#vlan 2 name tech Switch(vlan)#vlan 3 name sales Switch(vlan)#exit 进入全局设置模式 Switch#configure terminal,在Switch上创建VLAN,将Switch1的各端口划分在VLAN中 Switch(config)#interface FastEthernet 0/1 Switch(config-if)#switchpor

14、t mode access Switch(config-if)#switchport access vlan 2 Switch(config-if)#interface FastEthernet 0/2 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 3 Switch(config-if)#interface FastEthernet 0/3 Switch(config-if)#switchport mode access Switch(config-if)#switchport

15、 access vlan 2,在Switch上创建VLAN,配置与Switch2连接的Trunk接口 Switch(config-if)#interface FastEthernet 0/11 Switch(config-if)#switchport mode trunk 在Switch2上创建VLAN Switchenable Switch#vlan database Switch(vlan)#vlan 3 name sales Switch(vlan)#exit Switch#configure terminal,在Switch上创建VLAN,将Switch2的各端口划分在VLAN中 Sw

16、itch(config)#interface FastEthernet 0/1 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 3 Switch(config-if)#interface FastEthernet 0/2 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 3 配置与Switch1连接的Trunk接口 Switch(config-if)#interfac

17、e FastEthernet 0/11 Switch(config-if)#switchport mode trunk,实验结果,在Switch1上用 show vlan 查看VLAN信息 VLAN Name Status Ports - - - - 1 default active Fa0/4, Fa0/5, Fa0/6, Fa0/7 Fa0/8, Fa0/9, Fa0/10, 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 Gig0/1,

18、Gig0/2 2 tech active Fa0/1, Fa0/3 3 sales active Fa0/2 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 - - - - - - - - - - - 1 enet 100001 1500 - - - - - 0 0

19、 2 enet 100002 1500 - - - - - 0 0 3 enet 100003 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 0 0 1003 tr 101003 1500 - - - - - 0 0 1004 fdnet 101004 1500 - - - ieee - 0 0 1005 trnet 101005 1500 - - - ibm - 0 0 Remote SPAN VLANs - Primary Secondary Type Ports - - - -,实验结果,在Switch1上用 show interf

20、aces FastEthernet 0/1 switchport 查看端口信息 Name: Fa0/1 Switchport: Enabled Administrative Mode: static access Operational Mode: static access Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: native Negotiation of Trunking: Off Access Mode VLAN: 2 (tech) Trunking Native M

21、ode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administ

22、rative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled: All Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Unknown unicast blocked: disabled Unknown multicast blocked: disabled Appliance trust: none,实验结果,在S

23、witch1上用 show interfaces FastEthernet 0/2 switchport 查看端口信息 Name: Fa0/2 Switchport: Enabled Administrative Mode: static access Operational Mode: static access Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: native Negotiation of Trunking: Off Access Mode VLAN: 3 (sal

24、es) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal

25、 VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled: All Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Unknown unicast blocked: disabled Unknown multicast blocked: disa Appliance tr

26、ust: none,实验结果,在Switch1上用 show interfaces FastEthernet 0/11 switchport查看端口信息 Name: Fa0/11 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (def

27、ault) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk norm

28、al VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled: All Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Unknown unicast blocked: disabled Unknown multicast blocked: disabled Applia

29、nce trust: none,实验结果,在Switch2上用 show vlan 查看VLAN信息 VLAN Name Status Ports - - - - 1 default active Fa0/3, Fa0/4, Fa0/5, Fa0/6 Fa0/7, Fa0/8, Fa0/9, Fa0/10 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, Gig0/1, Gig0/2 3 sales active Fa0/1, Fa0/2 10

30、02 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 - - - - - - - - - - - 1 enet 100001 1500 - - - - - 0 0 3 enet 100003 1500 - - - - - 0 0 1002 fddi 101002 1500 -

31、 - - - - 0 0 1003 tr 101003 1500 - - - - - 0 0 1004 fdnet 101004 1500 - - - ieee - 0 0 1005 trnet 101005 1500 - - - ibm - 0 0 Remote SPAN VLANs - Primary Secondary Type Ports - - - -,实验结果,在Switch2上用 show interfaces FastEthernet 0/1 switchport 查看端口信息 Name: Fa0/1 Switchport: Enabled Administrative Mod

32、e: static access Operational Mode: static access Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: native Negotiation of Trunking: Off Access Mode VLAN: 3 (sales) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none

33、 Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLA

34、Ns Enabled: All Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Unknown unicast blocked: disabled Unknown multicast blocked: disabled Appliance trust: none,实验结果,在Switch2上用 show interfaces FastEthernet 0/11 switchport 查看端口信息 Name: Fa0/11 Switchport: Ena

35、bled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-associatio

36、n: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunk

37、ing VLANs Enabled: All Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Unknown unicast blocked: disabled Unknown multicast blocked: disabled Appliance trust: none,查看各台主机的连通性,在配置VLAN之后,回答【问题2】: 每台主机相互ping,查看哪些主机可以连通,哪些不可以?为什么? 注:可以用 ping -n 1 255.255.25

38、5.255 发起一个受限广播,(参数 -n 1指明只发送一次,免得默认发送4次受到干扰),观察都收到了哪些主机的回复?,DTP的配置,将Switch1的FastEthernet 0/11接口的Trunk配置为desirable模式: Switch1(config)#interface FastEthernet 0/11 Switch1(config-if)#shutdown Switch1(config-if)#switchport mode dynamic desirable Switch1(config-if)#no shutdown 将Switch2的FastEthernet 0/11接

39、口的Trunk配置为auto模式: Switch2(config)#interface FastEthernet 0/11 Switch2(config-if)#shutdown Switch2(config-if)#switchport mode dynamic auto Switch2(config-if)#no shutdown,实验结果,在Switch1上用 show interfaces FastEthernet 0/11 switchport查看端口信息 Name: Fa0/11 Switchport: Enabled Administrative Mode: dynamic de

40、sirable Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administrative p

41、rivate-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled: All P

42、runing VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Unknown unicast blocked: disabled Unknown multicast blocked: disabled Appliance trust: none,实验结果,在Switch2上用 show interfaces FastEthernet 0/11 switchport 查看端口信息 Name: Fa0/11 Switchport: Enabled Administrati

43、ve Mode: dynamic auto Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Ad

44、ministrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs

45、Enabled: All Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Unknown unicast blocked: disabled Unknown multicast blocked: disabled Appliance trust: none,课后实验(1),按照课件中拓扑及端口配置,修改Switch1和Switch2的FastEthernet 0/11端口,考察DTP协议的运行规则,并通过实验回答以下问题: 1、将Switch1和Swi

46、tch2都设置为negotiate模式,考察以下组合,哪些可以形成Trunk?,2、将Switch1设置为nonegotiate模式,Switch2仍为negotiate模式,再考察以下组合,哪些可以形成Trunk?在配置时与两者都是negotiate模式时有什么区别? 注意:考虑将Switch1设置为nonegotiate模式时,Switch1还能否设置为dynamic desirable或dynamic auto模式?,课后实验(2),注意事项,每次连接好线路或在接口上执行shutdown和noshutdown后,要等到拓扑图中连接线上的“点”变成绿色。 配置完交换机后,记得输入以下命令 copy running-config startup-config 保存,这样下次重新打开程序后,配置还在。,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 其他


经营许可证编号:宁ICP备18001539号-1