《vlantrunk配置解析》由会员分享,可在线阅读,更多相关《vlantrunk配置解析(39页珍藏版)》请在金锄头文库上搜索。
1、Chapter,1,第6章内容回顾,交换机的基本配置与查看 主机名、密码、IP地址与网关VLAN 划分VLAN的作用 VLAN的种类 静态VLAN的配置IOS的使用技巧 ?的使用 Tab键的使用 命令简写 命令缓存,Chapter,2,VLAN Trunk,第7章,Chapter,3,本章目标,能够配置VLAN Trunk,实现跨交换机的VLAN通讯,并能排除一般的配置故障理解Trunk的概念和工作原理理解802.1q和ISL两种封装方式的工作原理,Chapter,4,本章结构,VLAN Trunk,Trunk的协商,Trunk的概念和作用,封装方式,VLAN Trunk的原理,VLAN Tr
2、unk的配置,配置,排错,802.1q,ISL,Chapter,5,多个交换机上的VLAN应用,Fast Ethernet,工程VLAN 市场VLAN 会计VLAN,1楼,2楼,3楼,Chapter,6,交换机之间的VLAN通信31,VLAN 1,VLAN 2,VLAN 3,VLAN 1,VLAN 2,VLAN 3,如何实现交换机之间的VLAN通信? 每个VLAN一条链路?,Chapter,7,交换机之间的VLAN通信32,VLAN 1,VLAN 2,VLAN 3,VLAN 1,VLAN 2,VLAN 3,如何实现交换机之间的VLAN通信? 只使用一条链路,那么来自多个VLAN的数据如何标识?
3、,Chapter,8,交换机之间的VLAN通信33,例如:三个分别来自1、2、3班级的学生,到另一个学校去,分别要参观1、2、3班的上课情况,对方的学校怎么识别他们分别应该去哪个班级?,Chapter,9,VLAN标识,交换机给每个去往其他交换机的数据帧打上VLAN标识,VLAN 1,VLAN 2,VLAN 3,VLAN 1,VLAN 2,VLAN 3,中继链路(Trunk),接入链路(Access),VLAN 1标记,VLAN 3标记,Chapter,10,VLAN标识的种类,以太网上实现中继可用两种封装类型 ISL(Cisco私有协议) IEEE 802.1Q,Chapter,11,IEE
4、E802.1Q的工作原理和帧格式21,中继链路,接入链路,802.1Q 标记 4字节,Chapter,12,IEEE802.1Q的工作原理和帧格式22,标准以太网帧,TCI,12bit,可标识的VLAN ID为4096个,带有IEEE802.1Q标记的以太网帧,Chapter,13,Cisco ISL工作原理和帧格式31,中继链路,VLAN 2,接入链路,ISL头 26字节,CRC 4字节,Chapter,14,Cisco ISL工作原理和帧格式32,26字节ISL头,4字节ISL尾,Chapter,15,Cisco ISL工作原理和帧格式33,Chapter,16,ISL和802.1Q 的异
5、同,相同点 都是显式标记,即帧被显式标记了VLAN的信息 不同点 IEEE 802.1Q是公有的标记方式,ISL是Cisco私有的 ISL采用外部标记的方法,802.1Q采用内部标记的方法 ISL标记的长度为30字节,802.1Q标记的长度为4字节,Chapter,17,中继的几种模式和协商21,VLAN 1,VLAN 2,VLAN 3,模式为Access,动态:可以成为Trunk,动态:希望成为Trunk,模式为Trunk,Chapter,18,中继的几种模式和协商22,模式,Chapter,19,阶段总结,什么是Trunk?什么是Access Link? Trunk的封装方式 802.1Q
6、 ISL Trunk的接口协商模式,Chapter,20,阶段练习,如果需要与其他厂家的交换机连接配置VLAN Trunk,需要使用哪种标记方式?带有VLAN标记的数据帧,普通的主机能否正确读出?,Chapter,21,配置接口为Trunk模式,Switch(config)# interface interface-id Switch(config-if)#switchport mode ?access Set trunking mode to ACCESS unconditionallydynamic Set trunking mode to dynamically negotiate ac
7、cess or trunk modetrunk Set trunking mode to TRUNK unconditionally Switch(config-if)#switchport mode trunk,接口为接入模式,接口为动态协商模式,接口为中继模式,Chapter,22,配置接口为动态协商模式,Switch(config-if)#switchport mode dynamic ?auto Set trunking mode dynamic negotiation parameter to AUTOdesirable Set trunking mode dynamic negot
8、iation parameter to DESIRABLE,自动,企望,Chapter,23,查看接口模式,Switch#show interface interface-id switchport Name: Fax/x Switchport: Enabled Administrative Mode: dynamic desirable Operational Mode: down Administrative Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Tru
9、nking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Operational private-vlan: none Trunking VLANs Enabled: ALL Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL,接口模式缺省为 dynamic
10、desirable,封装类型为802.1q,Chapter,24,配置VLAN Trunk实例,VLAN 1,VLAN 2,VLAN 3,VLAN 1,VLAN 2,VLAN 3,Port 13,Port 410,Port 1123,Port 24,Port 24,SW1,Chapter,25,配置VLAN Trunk 41,第一步:在交换机上添加VLAN SW1#vlan database SW1(vlan)#vlan 2 VLAN 2 added:Name: VLAN0002 SW1(vlan)#vlan 3 VLAN 3 added:Name: VLAN0003 SW1(vlan)#ex
11、it APPLY completed. Exiting,Chapter,26,配置VLAN Trunk 42,第二步:将接口添加到相应的VLAN中 SW1#config terminal SW1(config)#interface range f0/4 - 10 SW1(config-if-range)#switchport access vlan 2 SW1(config)#interface range f0/11 - 23 SW1(config-if-range)#switchport access vlan 3,Chapter,27,配置VLAN Trunk 43,第三步:配置交换机之
12、间互联的端口为Trunk SW1(config)#interface f0/24 SW1(config-if)#switchport mode trunk,Chapter,28,配置VLAN Trunk 44,VLAN 1,VLAN 2,VLAN 3,VLAN 1,VLAN 2,VLAN 3,Port 13,Port 410,Port 1123,Port 24,Port 24,Port 1,Port 210,Port 11-23,SW2,请学员完成配置,Chapter,29,查看端口状态,SW1#show interface f0/24 switchport Name: Fa0/24 Swit
13、chport: Enabled 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
14、-association: none Administrative private-vlan mapping: none Operational private-vlan: none Trunking VLANs Enabled: ALL Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL,接口模式配置为Trunk,接口工作模式为Trunk,Trunk协议类型为802.1q,Trunk可以承载所有的VLAN,Chapter,30,配置结果,如果配置正确 连接在SW1上的属于VLAN 1主机
15、能够ping通SW2上VLAN 1的主机 VLAN2与VLAN3同理,Chapter,31,从Trunk中添加、删除Vlan,去除VLANSwitch (config-if )# switchport trunk allowed vlan remove vlan-list添加VLAN Switch (config-if)# switchport trunk allowed vlan add vlan-list检查中继端口允许VLAN的列表 Switch # show interface interface-id switchport,Chapter,32,从Trunk中删除Vlan配置实例,S
16、W1(config-if)#switchport trunk allowed vlan remove 2 SW1(config-if)#end SW1#show interface f0/24 switchport Name: Fa0/24 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunki
17、ng: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Operational private-vlan: none Trunking VLANs Enabled: 1,3-1005 Pruning VLANs Enabled: 2-1001 Capture Mode Disabled,