基本VTP配置
交换机上vtp的配置

任务3 在catalyst2950 交换机上配置vtp一、实验目的:掌握vtp的配置,深入了解vtp的工作原理,并掌握调试和检查方法。
二、背景描述:企业有采购部和销售部两个部门,采购部需要实时了解销售部的销售情况,以便做出合理的采购方案。
为了保持通信通畅,采购部与销售部在相同的vlan下。
三、实验拓扑结构:VTP网络拓扑图四、实验步骤:1.交换机Host name和Trunk配置Switch1>e nableSwitch1#config tSwitch1(co nfig)#host name SwitchA // SwitchA(co nfig)#i nterface faO/1SwitchA(c on fig-if)#switchport mode trunk // SwitchA(co nfig-if)#exitSwitch2>e nable更改switch1 为switchA 设置fa0/1为trunk模式更改switch2 为switchBSwitch2#config tSwitch2(co nfig)#host name SwitchB // SwitchB(config)#interface fa0/1SwitchB(config-if)#switchport mode trunk // SwitchB(config-if)#exitSwitchB(config)#interface fa0/2SwitchB(config-if)#switchport mode trunk // SwitchB(config-if)#exit 设置fa0/1 为trunk 模式设置fa0/2 为trunk 模式Switch3#config tSwitch3(config)#hostname SwitchCSwitchC(config)#interface fa0/1// 更改switch3 为switchCSwitchC(config-if)#switchport mode trunk SwitchC(config-if)#exit // 设置fa0/2 为trunk 模式Switch3>enable 2. 配置交换机的VTPSwitchA(config)#vtp domain Cisco // Change VTP domain from NULL to Cisco SwitchA(config)#vtp mode server // Device mode already VTP SERVER. 设置SwitchA 的域名为Cisco 设置vtp 为serverSwitchB(config)#vtp domain Cisco // 设置SwitchB 的域名为CiscoDomain name already ser to CiscoSwitchB(config)#vtp mode transparent // 设置vtp 为transparentSwitchC(config)#vtp domain Cisco // Change VTP domain from NULL to Cisco SwitchC(config)#vtp mode client // 设置SwitchC 的域名为Cisco 设置vtp 为client3. 验证VTPSwitchA# show vtp statusSwitchAt3haw vtp VTP VeraianCcnfiguration RevisionMaximum VLANs supported locally : 2S6:S :Server:Cisco:Di^abl&di Disabled:Disabled:0xA9 OxCB 0x52 0x12 0x94 0x71 0x£9 OxSCLocal updates ID is 0.0.0.0 ■:nc valid interface found)SwitchAtSwitchB# show vtp statusSwitchB^en^ble SuitchBtshow vtp VTF VersionCcnfiguraticn ReviHicnMaxinum VLANm supported locally Number cf exiating VLANm VTF Operaring - Mode VTF Domain Nans VTF Pruning Mede VTP V2 MadeVTP Tcaps Generation MD5 digestConfiguration last modified by SwitchB#|SwitchC# show vtp statusSwitch-C^shcw vtp srstus VTF VersionCcnfiguraticfi P.evisicnMaximuni VLAMs supperted locally Humber of existing '/LANs VTF Dperi^inj Mede VTF Domain Name VTF Pruning Me de VTP V2 Mede VTF Traps Generaticn MD5 digestConfiguraticn last modified by 0 SwirchC#| :0 :2S5 z S :Client:Cisco :Disabled :Disabled :Disabled:0xA9 0X C8 0K 52 0X 12 0X 94 0X 71 0x^9+ 0.0*0 at 0-0-00 00:00:00Ccnfiguraticn lasr modified by0.0.0.0ar 0-0-0000:00:00tTumbez of existing ^TANs VTP Opecoting Mede VTP Oqjnain VTP Pruning Mode VTP V2 Mede VTP Traps {Jeneration MDS digest:2SS :5Transparent :Cisco Disabled Dinabled Disabled0xA9 QxCB 0xS2 0x1: 094 0x71 QxZS QxSC4•配置交换机的vlan,并验证vtp各模式的特点(1) SwitchA交换机vlan的配置SwitchA# vlan database SwitchA(vlan)#vlan 2 // SwitchA(vlan)#vlan 3 //SwitchA(vlan)#exit(2) SwitchB 交换机 vlan 的配置 SwitchB# vlan databaseSwitchB(vlan)#vlan 4 // SwitchB(vlan)#vlan 5 //SwitchB(vlan)#exit6.在交换机 SwitchC 上 show vlan ,结果是 SwitchC 加入了 vlan2 , vlan3,如下图所示:5.配置交换机的 vtp 口令 (1) SwitchA 交换机 vtp 口令配置: SwitchA# config tSwitchA(config)#vtp password cisco SwitchA(config)#exit (2) SwitchB 交换机 vtp 口令配置: SwitchB# config t SwitchB(config)#vtp password cisco SwitchB(config)#exit (3) SwitchC 交换机 vtp 口令配置: SwitchC# config t SwitchC(config)#vtp password cisco SwitchC(config)#exit // 设置 vtp 密码为 cisco// 设置 vtp 密码为 cisco// 设置 vtp 密码为 cisco新建 vlan2 新建 vlan3新建 vlan4 新建 vlan5r VTP Client ?Physical Config ) CLIIOS Command Line Interfacen w 亠LT-riiZIM X JL-I H IT 丄■-Na.zDiz百七口P 口:rf■1d-ef eu.lt activeFaO/JL, Fa0/3p Fa0-/4r FaO/SFsOZ€, FaO/7.FaO/3FaO/10r Fa0/ll…. FaO/12,FaO/13FaO/14, FaO/l£p FaO/lfi,FaQ/17FaO/lB, FaO/13. FaO/20,F*O/22, Faa/23,. F*O/24FaO/2X z1^LAN0002active3VUUST0003ac t iiu p e1002 f dd.±—-daf aigrt/u-Tiaup1003c-a k*n-£ 丄ng— defaixl 匚A et/unaup10-0-4 f d.d.ina 七—da f at口JLt a iTt/11 Fl a up1005t me t - <le f au.1 匸aet/unsupT^pa SAID MTU Paxrenx; SfexnyTJo Brl-dgeNo Stp B■若旦Gtcd 冒Tran al Trans^ 1ono七10QQG1l&QQ—— -一一O02enet 100Q口21500= = =- = 00□■anst 10QQQ31B0Q- - -- - 00二1QQ2ra<ii laioaz15QQ- - -一一Q0■=Copy | PasteL. -J在SwitchA上新建vlan 6,发现SwitchC上的vlan与SwitchA实现同步更新: SwitchA# vla n database SwitchA(vlan)#vlan 6 // 新建vlan6SwitchA(co nfig)#exitSwitchC的show vlan结果如下图:。
实验四:Trunk和VTP配置报告

实验四:Trunk和VTP配置⏹实验目的1、掌握Trunk和VTP工作原理2、学习配置Trunk的命令和步骤3、学习配置VTP命令和步骤⏹实验要求1、拓扑与地址规划;2、Trunk基本配置和VTP配置3、验证Trunk和VTP配置并给出配置清单⏹实验拓扑(可选)⏹实验设备(环境、软件)交换机4台,交叉线4条,直通线2条,Pc机2台。
⏹实验设计到的基本概念和理论给出Trunk和VTP基本概念,VTP的三种模式Trunk:是两个交换机之间网络信息传递的物理和逻辑的连接;一个Trunk就是支持传递多个VLAN信息的点到点的链路;Trunk的目的是保留端口:Trunk将在一个物理链路上绑定多个虚链路,从而在两台交换机之间允许在单一物理链路上传输多个VLAN的信息VTP:是一个通告VLAN信息的信息系统;VTP维护整个管理域VLAN信息的一致性;VTP仅在Trunk端口上发送通告VTP的三种模式:VTP Server、VTP Client 和 VTP Transparent 实验过程和主要步骤1、绘制网络拓扑2、交换机之间接口配置TrunkSwitch3:Switch(config)#int f0/1Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 10Switch(config-if)#int f1/1Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to upSwitch(config-if)#int f2/1Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet2/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet2/1, changed state to upSwitch(config-if)#Switch0:Switch1:Switch2:3、VTP的配置。
单元任务书07_配置VTP

单元任务书07_配置VTP♑任务目标:1、能够配置VTP2、能够查看VTP状态信息♑学习形式✧小组协作,共同完成♑英语词汇:♑实践任务:任务一;VTP基本配置需求描述:⏹VTP域名为test⏹交换机SW1为Server模式,SW2、SW3为Client模式,学习SW1的VLAN信息推荐步骤:1、在SW1配置VTP,mode为server模式SW1(config)# vtp mode server2、在SW2配置VTP,mode为client模式SW2(config)# vtp mode client3、在SW3配置VTP,mode为client模式SW3(config)# vtp mode client4、在SW1配置VLANSW1(config)# vlan 2SW1(config-vlan)#exitSW1(config)# vlan 3SW1(config-vlan)#exit5、配置SW1的管理IP地址SW1(config)#int vlan 1SW1(config-if)# ip add 192.168.1.1 255.255.255.0SW1(config-if)# no shut6、查看SW1、SW2、SW3VLAN信息SW1# show vtp status任务二:VTP同步实验环境⏹SW1为服务器模式,SW2为客户机模式⏹VTP的域名为benet,密码为test⏹在SW1上配置VLAN 2和VLAN 3实验拓扑需求描述:配置完成并且同步以后,更改SW1的VTP配置,查看SW2是否还能学到SW1上的VLAN。
通过更改VTP配置,查看哪些原因导致客户机模式的交换机无法学习到VLAN信息。
推荐步骤:1、按照实验要求配置交换机,使得SW2学习到SW1的VLAN信息SW1#vlan databaseSW1(vlan)#vtp domain benetSW1(vlan)#vtp serverSW1(vlan)#vtp password testSW1(vlan)#vlan 2SW1(vlan)#vlan 3SW1(vlan)#exitSW1(config)#int f0/0SW1(config-if)#sw mo trunkSW1(config-if)#exitSW2#vlan databaseSW2(vlan)#vtp domain benetSW2(vlan)#vtp clientSW2(vlan)#vtp password testSW2(vlan)#exitSW2(config)#int f0/0SW2(config-if)#sw mo trunkSW2(config-if)#exit2、更改SW1的VTP密码,然后在SW1上配置VLAN4,查看SW2是否能学到VLAN4;然后将SW1的密码改回原密码,再查看SW2是否能学到VLAN4的信息3、更改SW1的VTP域名,然后在SW1上配置VLAN5,查看SW2是否能学到VLAN5,然后将SW1的域名改回原域名,再查看SW2是否能学到VLAN5的信息4、更改SW2的VTP模式为透明模式,然后在SW1上配置VLAN6,查看SW2是否能学到VLAN6;然后将SW2改回原模式,再查看SW2是否能学到VLAN6的信息;5、更改SW1和SW2之间的链路模式为ACCESS,然后在SW1上配置VLAN7,查看SW2是否能学到VLAN7;然后将SW1和SW2之间的链路模式改回Trunk,再查看SW2是否能学到VLAN7的信息W3VLAN信息。
实验二十:VTP配置

实验二十:VTP配置VTP(VLAN Trunking Protocol)是一个用于传播和同步关于整个交换网络的VLAN信息的协议,工作在OSI参考模型的第二层。
VTP使我们在扩展交换网络规模时减少人工配置的工作量,并通过统一地管理交换网络中VLAN的增加、删除和名称变更,以维持整个网络VLAN配置的一致性,最大限度地减少可能带来问题的错配和配置不一致情况(如VLAN名称重复使用或错误的VLAN类型说明)。
VTP的三种模式:Server服务器模式、Client客户机模式、Transparent 透明模式。
1、Server 服务器模式:可以创建、更改和删除VLAN信息,并设置用于整个VTP域的其它配置参数。
Server交换机上设置的这些消息会通过中断线路依次传到相同域中的VTP客户机中,以同步相同域内多台交换机Vlan的配置。
2、Client客户机模式:不能创建、更改和删除VLAN,只能通过中继线路同步接收相同域内VTP server服务器发来的VLAN信息。
3、Transparent透明模式:当前交换机不参加VTP,该种模式主要是用作本地管理,它不与其它交换机共享VLAN信息,但仍可以将VTP通告转送到其它交换机。
一、实验内容1、使用VTP协议实现多交换机VLAN配置二、实验目的1、掌握VTP原理及工作过程2、掌握VTP的三种工作模式3、掌握交换机Trunking中继线路的配置三、网络拓朴四、实验设备1、四台安装有windows 98/xp/2000的微机2、两台Cisco 2950 交换机3、多条直通网线和交叉网线4、思科(Cisco)专用控制端口连接电缆五、实验过程(需要将相关命令写入实验报告)1、使用直通线和交叉线将电脑与交换机、交换机与交换机正确进行连接2、配置各主机IP地址和子网掩码3、将交换机A设置为VTP Server服务器模式,同时设置VTP域名称并在该交换机上添加添加VLAN 100和VLAN 2004、将交换机B设置为VTP Client客户机模式。
VLAN TRUN VTP基本配置总结配置

VLAN(Virtual Local Area Network )中文解释虚拟局域网实现思想把同一物理局域网内的不同用户逻辑的划分成不同广播域定义一种将局域网设备从逻辑上划分成一个个网段,从而实现虚拟工作组的新兴数据交换技术作用 1.可有效的控制广播风暴的发生(提高网络性能)2.使网络拓扑图更加灵活3.控制网络中不同部门,不同站点间的互访(安全)VLAN标准IEEE802.1Q Cisco ISL标签(Cisco私有)VLAN添加命令一、Database配置方法switch>enableswitch#vlan database进入VLAN数据库配置模式switch(vlan)#vlan vlanID name vlan name创建VLAN并命名switch(vlan)#exi t 保存并退出配置实例switch>enable 进入特权模式switch#vlan database 进入VLAN数据库配置模式switch(vlan)#vlan 2 name er 创建VLAN2 名称erVLAN 2 added: 提示信息:VLAN2已经添加Name: er 提示信息:名称erswitch(vlan)#exit 退出并保存APPLY completed. 提示信息:保存成功Exiting.... 退出……二、全局配置方法Switch>enableSwitch#config terminalSwitch(config)#vlan vlanID输入vlanID,VLAN配置模式Switch(config)#nam vlanName输入VLAN名称(可选)Switch(config)#exit 退出VLAN删除命令no vlan vlanID一、 Database删除方法Switch>enable 进入特权模式Switch#vlan database 进入VLAN数据库配置模式Switch(vlan)#no vlan 2 删除VLAN 2Deleting VLAN 2... 提示信息:删除VLAN 2Switch(vlan)#exit 保存退出APPLY completed. 提示信息:完成Exiting.... 退出……二、 全局删除方法Switch>enableSwitch#configure terminalSwitch(config)# no vlan 2将端口添加到VLAN中Switch>enSwitch#conf tSwitch(config)#int f0/0 进入0/0接口Switch(config-if)#switchport mode access定义为二层端口模式Switch(config-if)#switchport access vlan 2将端口分配给VLAN 2Switch(config-if)#interface range f0/1 – 5 进入0/1 – 5接口Switch(config-if-range)#switchport mode accessSwitch(config-if-range)#switchport access vlan 3Switch(config-if-range)#end查看VLAN命令Switch#show vlan briefSwitch#show vlan id vlanIDSwitch#show vlan-switch briefSwitch#sh vlan-switch briefVLAN Name Status Ports---- -------------------------------- --------- ------------------------------- 1 default active Fa0/6, Fa0/7, Fa0/8, Fa0/9Fa0/10, Fa0/11, Fa0/12, Fa0/13 Fa0/14, Fa0/152 er active Fa0/0, Fa0/1, Fa0/2, Fa0/3Fa0/4, Fa0/53 san active4 si active1002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default active配置实例SW>enSW#vlan daSW(vlan)#vlan 2 na erVLAN 2 modified:Name: erSW(vlan)#vlan 3 na sanVLAN 3 modified:Name: sanSW(vlan)#exitAPPLY completed.Exiting....SW#conf tEnter configuration commands, one per line. End with CNTL/Z. SW(config)#int f0/0SW(config-if)#swi mo accSW(config-if)#swi acc vlan 2SW(config-if)#int f0/15SW(config-if)#swi mo accSW(config-if)#swi acc vlan 3SW(config-if)#exitSW(config)#do sh vlan-s bVLAN Name Status Ports---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4Fa0/5, Fa0/6, Fa0/7, Fa0/8Fa0/9, Fa0/10, Fa0/11, Fa0/12Fa0/13, Fa0/142 er active Fa0/03 san active Fa0/151002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default activeTRUNK (中继)中文解释:中继TRUNKING是基于OSI第二层数据链路层封转类型:ISL(Cisco私有协议,用于以太网的内部交换链路) IEEE 802.1Q(dot1q)作用:保证在跨越多个交换机上建立的同一个VLAN的成员能够相 互通信原理:交换机给每个去往其他交换机的数据帧打上VLAN标识 IEEE 802.1Q(dot1q) 工作原理和帧格式工作原理采用内部标记的方法标记的长度为4字节帧格式 Cisco ISL工作原理和帧格式工作原理 采用外部标记的方法标记的长度为30字节帧格式中继的集中模式配置命令Swithc>enableSwitch#configure terminalSwitch(config)#interface range f0/14 - 15SWITCH(config-if-range)#switchport mode ?access Set trunking mode to ACCESS unconditionally此模式为接入模式,用于连接PC的端口trunk Set trunking mode to TRUNK unconditionally此模式为TRUNK模式,用于交换机之间连接dynamic Set trunking mode to dynamically negotiateaccess or trunk mode此接口为动态协商模式Switch(config-if-range)#switchport mode trunk将接口设置为中继模式Switch(config-if-range)#switchport mode access将接口设置为接入模式配置实例SW1>enSW1#vlan da SW1(vlan)#vlan 2 na er VLAN 2 modified: Name: erSW1(vlan)#vlan 3 na san VLAN 3 modified: Name: san SW1(vlan)#exit APPLY completed. Exiting....SW1(config)#int ran f0/14 - 15 SW1(config-if-range)#swi mo tr SW1(config-if-range)#no sh SW1(config-if-range)#int f0/0 SW1(config-if)#swi mo ac SW1(config-if)#swi ac vlan 2 SW1(config-if)#no sh SW1(config-if)#int f0/1 SW1(config-if)#swiSW1(config-if)#swi mo ac SW1(config-if)#swi ac vlan 3 SW1(config-if)#no sh另一台交换机配置相同即可创建VLAN2和VLAN3将14-15接口配置为中继 将端口加入相应VLAN 中查看接口模式命令Switch#show interface interface-id switchport中文解释:VLAN中继协议(虚拟局域网干道协议)作用:它是一个OSI参考模型第二层的通信协议,主要用于管理在同一个域的网络范围内VLAN的建立、删除和重命名并自动地将信息向网络中其它的交换机广播优势:减少管理员负担和认为错误,提高安全性。
VTP配置

VTP(VLAN Trunking Protocol)配置VTP domain:ccxx一.将各台交换机间链路设置中继S1(config)#int fa0/23S1(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23, changed state to upS1(config-if)#exitS1(config)#S2(config)#interface range fastEthernet 0/23-24 选择多个端口S2(config-if-range)#switchport mode trunk 开启中继模式%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to upS2(config-if-range)#exitS2(config)#S3(config)#int f0/24S3(config-if)#switchport mode trunkS3(config-if)#exitS3(config)#二.设置三台交换机处于ccxx的VTP域,且密码为ciscoS1(config)#vtp domain ccxx 设置VTP域名为ccxx Changing VTP domain name from NULL to ccxxS1(config)#vtp password cisco 设置VTP密码为cisco Setting device VLAN database password to ciscoS1(config)#S2(config)#vtp domain ccxxDomain name already set to ccxx.S2(config)#vtp password ciscoSetting device VLAN database password to ciscoS2(config)#S3(config)#vtp domain ccxxDomain name already set to ccxx.S3(config)#vtp password ciscoPassword already set to ciscoS3(config)#三.设置S1为服务器模式,S2为透明模式,S3为客户端模式S1(config)#vtp mode server 设置S1为服务器模式Device mode already VTP SERVER.S1(config)#S2(config)#vtp mode transparent 设置S2为透明模式Setting device to VTP TRANSPARENT mode.S2(config)#S3(config)#vtp mode client 设置S3为客户模式Setting device to VTP CLIENT mode.S3(config)#四.在S1上创建人事部VLAN5和销售部VLAN10S1(config)#vlan 5S1(config-vlan)#name HRS1(config-vlan)#exitS1(config)#vlan 10S1(config-vlan)#name SalesS1(config-vlan)#exitS1(config)#五.查看S1的VLAN信息S1#show vlan briVLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4Fa0/5, Fa0/6, Fa0/7, Fa0/8Fa0/9, Fa0/10, Fa0/11, Fa0/12Fa0/13, Fa0/14, Fa0/15, Fa0/16Fa0/17, Fa0/18, Fa0/19, Fa0/20Fa0/21, Fa0/22, Fa0/245 HR active10 Sales active1002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default active六.查看S2的VLAN信息S2#show vlan briVLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4Fa0/5, Fa0/6, Fa0/7, Fa0/8Fa0/9, Fa0/10, Fa0/11, Fa0/12Fa0/13, Fa0/14, Fa0/15, Fa0/16Fa0/17, Fa0/18, Fa0/19, Fa0/20Fa0/21, Fa0/221002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default active由于S2是透明模式,所以不和其它域中交换机同步VLAN信息。
VTP的配置2020-10-27

VTP的配置2020-10-27VTP(VLAN Trunking Protocol):VLAN中继协议,也被称为⼲道协议。
它是思科私有协议。
⽤处是:在中有⼗⼏台,配置VLAN的很⼤,这时就可以使⽤VTP协议,把⼀台交换机配置成VTP Server, 其余交换机配置成VTP Client,这样他们可以⾃动学习到VTP server上的VLAN 信息。
VTP的⼯作原理:它是第⼆层的,主要⽤于管理在同⼀个域的⽹络范围内VLANs的建⽴、删除和重命名。
在⼀台VTP Server 上配置⼀个新的VLAN时,该VLAN的配置信息将⾃动传播到本域内的其他所有。
这些交换机会⾃动地接收这些配置,使其VLAN的配置与VTP Server保持⼀致,从⽽减少在多台设备上配置同⼀个VLAN信息的⼯作量,⽽且保持了VLAN配置的统⼀性。
VTP通过⽹络(ISL帧或cisco私有DTP帧)保持VLAN配置统⼀性。
VTP在系统级管理增加,删除,调整的VLAN,⾃动地将信息向⽹络中其它的交换机⼴播。
此外,VTP减⼩了那些可能导致安全问题的配置。
便于管理,只要在vtp server做相应,vtp client会⾃动学习vtp server上的vlan 信息* 当使⽤多重名字VLAN能变成交叉--连接。
* 当它们是错误地映射在⼀个和其它,VLAN便可从内部断开。
VTP有三种⼯作模式:VTP Server、VTP Client 和 VTP Transparent。
新出⼚时的默认配置是预配置为VLAN 1,VTP 模式为服务器。
⼀般⼀个内的整个⽹络只设⼀个VTP Server。
VTP Server维护该VTP域中所有VLAN 信息列表,VTP Server可以建⽴、删除或修改VLAN,发送并转发相关的通告信息,同步vlan配置,会把配置保存在NVRAM中。
VTP Client虽然也维护所有VLAN信息列表,但其VLAN的配置信息是从VTP Server学到的,VTP Client不能建⽴、删除或修改VLAN,但可以转发通告,同步vlan配置,不保存配置到NVRAM中。
VTP配置

通常情况下,我们需要在整个园区网或者企业网中的一组的交换机中保持VLAN数据库的同步,以保证所有交换机都能从数据帧中读取相关的VLAN信息进行正确的数据转发,然而对于大型网络来说,可能有成百上千台交换机,而一台交换机上都可能存在几十乃至数百个VLAN,如果仅凭网络工程师手工配置的话是一个非常大的工作量,并且也不利于日后维护——每一次添加修改或删除VLAN都需要在所有的交换机上部署。
在这种情况下,我们引入了VTP(VLAN Trunking Protocol)。
VTP即VLAN中继协议,也被称为虚拟局域网干道协议,是思科私有协议。
VTP有3种模式:服务器模式(Server);客户机模式(Client);透明模式(Transparent)。
Server模式:提供VTP消息(包括VLAN ID和名字信息);学习相同域名的VTP消息;转发相同域名的VTP消息;可以添加、删除和更改VLAN VLAN信息写入NVRAM。
Client模式:请求VTP消息;学习相同域名的VTP消息;转发相同域名的VTP消息;不可以添加、删除和更改VLAN VLAN信息不会写入NVRAM。
Transparent模式:不提供VTP消息;不学习VTP消息;转发VTP消息;可以添加、删除和更改VLAN,只在本地有效VLAN信息写入NVRAM。
新交换机出厂时的默认配置是预配置为VLAN1,VTP 模式为服务器。
在VTP域中有两个重要的概念:VTP域:也称VLAN管理域,由一个以上共享VTP域名的相互连接的交换机组成的。
也就是说VTP域是一组域名相同并通过中继链路相互连接的交换机;VTP通告:在交换机之间用来传递VLAN信息的数据包被称为VTP数据包。
VTP通告包括:汇总通告,子集通告,通告请求。
注意:VTP通过Trunk,VTP Server向其它交换机传输信息和接收更新。
若给VTP配置密码,那么本域内的所有交换机的VTP密码必须保持一致。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
基本VTP 配置任务1:执行基本交换机配置根据以下原则配置交换机S1、S2 和S3 并保存配置:????按照拓扑所示配置交换机主机名。
????禁用DNS 查找。
????将执行模式口令配置为class。
????为控制台连接配置口令cisco。
????为vty 连接配置口令cisco。
Switch>enableSwitch#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname S1S1(config)#enable secret classS1(config)#no ip domain-lookupS1(config)#line console 0S1(config-line)#password ciscoS1(config-line)#loginS1(config-line)#line vty 0 15S1(config-line)#password ciscoS1(config-line)#loginS1(config-line)#end%SYS-5-CONFIG_I: Configured from console by consoleS1#copy running-config startup-configDestination filename [startup-config]?Building configuration...[OK]任务2:配置主机PC 上的以太网接口使用地址表中的IP 地址和默认网关配置PC1、PC2、PC3、PC4、PC5 和PC6 的以太网接口。
任务3:在交换机上配置VTP 和安全功能步骤1. 启用S2 和S3 上的用户端口。
将用户端口配置为接入模式。
请参阅拓扑图来确定哪些端口连接到最终用户设备。
S2(config)#interface fa0/6S2(config-if)#switchport mode accessS2(config-if)#no shutdownS2(config-if)#interface fa0/11S2(config-if)#switchport mode accessS2(config-if)#no shutdownS2(config-if)#interface fa0/18S2(config-if)#switchport mode accessS2(config-if)#no shutdown步骤2. 检查三台交换机上的当前VTP 配置。
使用show vtp status 命令确定所有三台交换机的VTP 工作模式。
步骤3. 在所有三台交换机上配置工作模式、域名和VTP 口令。
在三台交换机上,全部将VTP 域名设置为Lab4,VTP 口令设置为cisco。
将S1 配置为服务器模式,S2配置为客户端模式,S3 配置为透明模式。
S1(config)#vtp mode serverDevice mode already VTP SERVER.S1(config)#vtp domain Lab4Changing VTP domain name from NULL to Lab4S1(config)#vtp password ciscoSetting device VLAN database password to ciscoS1(config)#endS2(config)#vtp mode clientSetting device to VTP CLIENT modeS2(config)#vtp domain Lab4Changing VTP domain name from NULL to Lab4S2(config)#vtp password ciscoSetting device VLAN database password to ciscoS2(config)#endS3(config)#vtp mode transparentSetting device to VTP TRANSPARENT mode.S3(config)#vtp domain Lab4Changing VTP domain name from NULL to Lab4S3(config)#vtp password ciscoSetting device VLAN database password to ciscoS3(config)#end步骤4. 为所有三台交换机上的中继端口配置中继和本征VLAN。
在所有交换机上,为FastEthernet 接口0/1-5 配置中继和本征VLAN。
以下仅提供了每台交换机的fa0/1 接口的配置命令。
S1(config)#interface fa0/1S1(config-if)#switchport mode trunkS1(config-if)#switchport trunk native vlan 99S1(config-if)#no shutdownS1(config-if)#interface fa0/2S1(config-if)#switchport mode trunkS1(config-if)#switchport trunk native vlan 99S1(config-if)#no shutdownS1(config-if)#endS2(config)#interface fa0/1S2(config-if)#switchport mode trunkS2(config-if)#switchport trunk native vlan 99S2(config-if)#no shutdownS3(config)#interface fa0/2S3(config-if)#switchport mode trunkS3(config-if)#switchport trunk native vlan 99S3(config-if)#no shutdownS3(config-if)#end步骤5. 在S2 和S3 接入层交换机上配置端口安全功能。
配置端口fa0/6、fa0/11 和fa0/18,使它们只支持一台主机,并且动态获知该主机的MAC 地址。
S2(config)#interface fa0/6S2(config-if)#switchport port-securityS2(config-if)#switchport port-security maximum 1S2(config-if)#switchport port-security mac-address stickyS2(config-if)#interface fa0/11S2(config-if)#switchport port-securityS2(config-if)#switchport port-security maximum 1S2(config-if)#switchport port-security mac-address stickyS2(config-if)#interface fa0/18S2(config-if)#switchport port-securityS2(config-if)#switchport port-security maximum 1S2(config-if)#switchport port-security mac-address stickyS2(config-if)#endS3(config)#interface fa0/6S3(config-if)#switchport port-securityS3(config-if)#switchport port-security maximum 1S3(config-if)#switchport port-security mac-address stickyS3(config-if)#interface fa0/11S3(config-if)#switchport port-securityS3(config-if)#switchport port-security maximum 1S3(config-if)#switchport port-security mac-address stickyS3(config-if)#interface fa0/18S3(config-if)#switchport port-securityS3(config-if)#switchport port-security maximum 1S3(config-if)#switchport port-security mac-address stickyS3(config-if)#end步骤6. 在VTP 服务器上配置VLAN。
本实验需要四个VLAN:?????VLAN 99 (management)?????VLAN 10 (faculty/staff)?????VLAN 20 (students)?????VLAN 30 (guest)在VTP 服务器上配置这些VLAN。
Packet Tracer 评分时会区分大小写。
S1(config)#vlan 99S1(config-vlan)#name managementS1(config)#vlan 10S1(config-vlan)#name faculty/staffS1(config-vlan)#exitS1(config)#vlan 20S1(config-vlan)#name studentsS1(config-vlan)#exitS1(config)#vlan 30S1(config-vlan)#name guestS1(config-vlan)#exit使用show vlan brief 命令检查S1 上是否创建了这些VLAN。
步骤7. 检查S1 上创建的VLAN 是否已分发给S2 和S3。
在S2 和S3 上使用show vlan brief 命令检查VTP 服务器是否已将其VLAN 配置传送给所有的交换机。
步骤8. 在S2 和S3 上创建新的VLAN。
S2(config)#vlan 88%VTP VLAN configuration not allowed when device is in CLIENT mode.S3(config)#vlan 88S3(config-vlan)#name testS3(config-vlan)#从S3 上删除VLAN 88。