Cisco交换机vtp配置
- 格式:doc
- 大小:113.50 KB
- 文档页数:8
Cisco VTP中继协议配置实践1.VTP协议:VLAN中继协议,VTP,VLAN TRUNKING PROTOCOL,是CISCO专用协议,大多数交换机都支持该协议。
VTP负责在VTP域内同步VLAN信息,这样就不必在每个交换上配置相同的VLAN信息。
VTP还提供一种映射方案,以便通信流能跨越混合介质的骨干。
VTP 最重要的作用是,将进行变动时可能会出现在的配置不一致性降至最低。
不过,VTP也有一些缺点,这些缺点通常都与生成树协议有关。
知识点:VLAN中继协议(VTP)利用第2层中继帧,在一组交换机之间进行VLAN通信.VTP从一个中心控制点开始,维护整个企业网上VLAN的添加和重命名工作,确保配置的一致性。
2.设计思路及需求:1、Cisco C3560配置成为VTP server并设置VTP管理域名称CCTV2、Cisco C3560创建三个VLAN(VLAN10 VLAN20 VLAN 30)并配置每个VLAN动态获取IP3、Cisco C3650 分配三个端口fa 0/1-3 设置为trunk4、三台Cisco C2960配置成为VTP client5、C2960_01 分配fa 0/1-5给VLAN 10 ,并设置fa0/24端口为trunk6、C2960_02 分配fa 0/1-5给VLAN 20 ,并设置fa0/24端口为trunk7、C2960_03 分配fa 0/1-5给VLAN 30 ,并设置fa0/24端口为trunk3.网络拓扑图:4.配置(1)Cisco C3560配置如下:##设置VTP 域名名称及VTP ServerC3560>enableC3560#vlan databaseC3560(vlan)#vtp domain CCTVC3560(vlan)#vtp server##创建VLAN 10 VLAN 20 VLAN 30 C3560(vlan)#vlan 10 name VLAN10C3560(vlan)#vlan 20 name VLAN20C3560(vlan)#vlan 30 name VLAN30C3560(vlan)#exit##VLAN配置IP地址3560#configure terminalC3560(config)#interface vlan 10C3560(config-if)#ip address 192.168.10.1 255.255.255.0C3560(config-if)#exitC3560(config)#interface vlan 20C3560(config-if)#ip address 192.168.20.1 255.255.255.0C3560(config-if)#exitC3560(config)#interface vlan 30C3560(config-if)#ip address 192.168.30.1 255.255.255.0C3560(config-if)#exit##配置DCHPC3560(config)#service dhcpC3560(config)#ip dhcp pool vlan10_dhcpC3560(dhcp-config)#network 192.168.10.0 255.255.255.0C3560(dhcp-config)#default-router 192.168.10.1C3560(dhcp-config)#dns-server 114.114.114.114C3560(dhcp-config)#exitC3560(config)#ip dhcp excluded-address 192.168.10.1 192.168.10.10 C3560(config)#ip dhcp pool vlan20_dhcpC3560(dhcp-config)#network 192.168.20.0 255.255.255.0C3560(dhcp-config)#default-router 192.168.20.1C3560(dhcp-config)#dns-server 114.114.114.114C3560(dhcp-config)#exitC3560(config)#ip dhcp excluded-address 192.168.20.1 192.168.20.10 C3560(config)#ip dhcp pool vlan30_dhcpC3560(dhcp-config)#network 192.168.30.0 255.255.255.0C3560(dhcp-config)#default-router 192.168.30.1C3560(dhcp-config)#dns-server 114.114.114.114C3560(dhcp-config)#exitC3560(config)#ip dhcp excluded-address 192.168.30.1 192.168.30.10##设置三个端口fastEthernet 0/1-3为trunk知识点:VLAN的封装类型,目前有ISL和802.1q(dot1q)两种协议,ISL是思科私有的VLAN封装协议,思科部分交换机支持ISL协议,使用该协议能提高VLAN传输性能。
CISCO交换机配置实例(VTP、VLAN、TRUNK、channel)本文通过实例为大家介绍CISCO交换机的一些常用功能的配置方法,包括VTP 配置、VLAN划分、Trunk配置、channel通道配置、双工模式配置等。
掌握这些配置方法基本上可以满足CISCO交换机一般的日常维护要求了。
网络拓扑图:1、配置VTP, 设置domain为dgmobile, Sw1为server, 其它switch配置为client。
Sw1(config)# vtp mode severSw1(config)# vtp domain dgmobileSw2(config)# vtp mode client2、在Sw1建立三个vlan, 要求在其它Sw2上通过VTP可以看到同样的vlan。
vlan2:engineering,vlan6:marketing,vlan9:accouting.Sw1(config)# vlan 2Sw1(config-vlan)#name engineeringSw1(config)# vlan 6Sw1(config-vlan)#name marketingSw1(config)# vlan 9Sw1(config-vlan)#name accouting3、把sw2的端口5,8,13划入vlan2;端口3,4,9划入vlan6;端口6,7,16划入vlan9。
Sw2(config)#int range fa0/5 , fa0/8 , fa0/13Sw2(config-if-range)#switchport access vlan 2Sw2(config)#int range fa0/3 , fa0/4 , fa0/9Sw2(config-if-range)#switchport access vlan 6Sw2(config)#int range fa0/6 , fa0/7 , fa0/16Sw2(config-if-range)#switchport access vlan 94、Sw1和Sw2的23和24端口互连,配置交换机间的Trunk,用802.1q封装。
本次讲解交换机vtp的vlan学习功能(相对于上一期各交换机vlan配置,使用中继线相连的交换机都需要进行相应的配置。
如果更改 VLAN,所有的相关交换机也要做变更,这样工作就太大了。
采用VTP (VLAN Trunking Protocol)协议可以简化配置工作。
VTP有三种工作模式:服务器模式、客户端模式和透明(transparent)模式,默认是服务器模式。
服务器模式的交换机可以设置VLAN配置参数,服务器会将配置参数发给其他交换机。
客户端模式的交换机不能设置VLAN配置参数,只能接受服务器模式的交换机发送的VLAN配置参数。
透明模式的交换机是相对独立的,它允许设置VLAN配置参数,但不向其他交换机发送自己的配置参数。
当透明模式的交换机收到服务器模式的交换机发送的VLAN配置参数时,仅仅是简单地转发给其他交换机,并不用来设置自己的VLAN参数。
当交换机处于VTP服务器模式时,如果删除一个VLAN,则该VLAN将在所有相同VTP的交换机上被删除。
当在透明模式下删除时,只在当前交换机上被删除)本例配置模型图命令行:SwitchA配置如下:Switch>enableSwitch#vlan database //进入vlan配置模式% Warning: It is recommended to configure VLAN from config mode,as VLAN database mode is being deprecated. Please consult userdocumentation for configuring VTP/VLAN in config mode.Switch(vlan)#vtp domain tzt //配置switchA为vtp域名为tztChanging VTP domain name from NULL to tztSwitch(vlan)#vtp password 123 //配置switchA为vtp密码为123Setting device VLAN database password to 123Switch(vlan)#vtp server //配置switchA为vtp服务器(默认为服务器模式)Device mode already VTP SERVER.Switch(vlan)#vlan 2 name TztA //配置vlan 2 名字为TztAVLAN 2 added:Name: TztASwitch(vlan)#vlan 3 name TztB //配置vlan3 名字为T ztBVLAN 3 added:Name: TztBSwitch(vlan)#exitAPPLY completed.Exiting....Switch#show vtp statusVTP Version : 2Configuration Revision : 2Maximum VLANs supported locally : 255Number of existing VLANs : 7VTP Operating Mode : Server //显示switchA为vtp服务器模式VTP Domain Name : tzt //显示switchB的vtp域名为tztVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0xF6 0x64 0x53 0x6B 0xF9 0x2F 0xA3 0xC2 Configuration last modified by 0.0.0.0 at 3-1-93 00:02:05Local updater ID is 0.0.0.0 (no valid interface found)Switch#show vlan //查看已配置vlan信息VLAN 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/23, Fa0/24Gig1/1, Gig1/22 TztA active //此处为刚才配置的vlan3 TztB active1002 fddi-default act/unsup1003 token-ring-default act/unsup1004 fddinet-default act/unsup1005 trnet-default act/unsupVLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 0 02 enet 100002 1500 - - - - - 0 03 enet 100003 1500 - - - - - 0 01002 fddi 101002 1500 - - - - - 0 01003 tr 101003 1500 - - - - - 0 01004 fdnet 101004 1500 - - - ieee - 0 01005 trnet 101005 1500 - - - ibm - 0 0Remote SPAN VLANs------------------------------------------------------------------------------Primary Secondary Type Ports------- --------- ----------------- ------------------------------------------Switch#conf t //进入全局模式Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#int g1/1Switch(config-if)#switchport mode trunk //配置trunk模式%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/1, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/1, changed state to upSwitch(config-if)#switchport trunk allowed vlan all //允许所有vlan通过switchA的端口g1/1 Switch(config-if)#exitSwitch(config)#exitSwitchB配置如下:Switch>enableSwitch#show vlan //查看当前已配置vlan信息。
任务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结果如下图:。
思科Cisco交换机配置——VTP管理交换机的VLAN配置实验操作详解本⽂讲述了思科Cisco VTP管理交换机的VLAN配置。
分享给⼤家供⼤家参考,具体如下:⼀、实验⽬的:将S1配置成VTP-Server,S2配置成VTP-Transparent,S3配置成VTP-Client,S4配置成VTP-Client⼆、拓扑图如下三、具体步骤:(1)S1交换机的配置Switch>enable --进⼊特权模式Switch#config terminal --进⼊全局配置模式Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname S1 --修改交换机名为S1S1(config)#vtp domain test --创建test域Changing VTP domain name from NULL to testS1(config)#vtp mode server --设置S1为ServerDevice mode already VTP SERVER.S1(config)#vlan 7 --创建并进⼊vlan 7端⼝,并开启S1(config-vlan)#vlan 8 --创建并进⼊vlan 8 端⼝,并开启S1(config-vlan)#interface f0/1 --进⼊f0/1端⼝S1(config-if)#switchport mode trunk --将端⼝改为trunk模式S1(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up(2)S2交换机的配置Switch#enable --进⼊特权模式Switch#config terminal --进⼊全局配置模式Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname S2 --修改交换机名为S2S2(config)#vtp mode transparent --将S2设置为TransparentDevice mode already VTP TRANSPARENT.S2(config)#interface range f0/1-2 --进⼊f0/1和f0/2端⼝S2(config-if)#switchport mode trunk --将端⼝改为trunk模式(3)S3交换机配置Switch#enable --进⼊特权模式Switch#config terminal --进⼊全局配置模式Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname S3 --修改交换机名为S3S3(config)#vtp mode client --将S3设置为ClientDevice mode already VTP CLIENT.S3(config)#interface range f0/1-2 --进⼊f0/1和f0/2端⼝S3(config-if)#switchport mode trunk --将端⼝改为trunk模式(4)S4交换机配置Switch#enable --进⼊特权模式Switch#config terminal --进⼊全局配置模式Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname S4 --将交换机名修改为S4S4(config)#vtp mode client --将S4设置为ClientDevice mode already VTP CLIENT.S4(config)#interface f0/1 --进⼊f0/1端⼝S4(config-if)#switchport mode trunk --将端⼝改为trunk模式四、验证,分别在各台交换机上查看VLAN(1)S1(2)S2解释:S2因为是隐藏模式,所以看不见vlan 7 和 vlan 8(3)S3解释:S3是客户端模式所以可以查看到vlan 7 和vlan 8(4)S4解释:S4因为是客户端模式,所以可以查看到vlan 7 和 vlan 8。
实验8 CISCO交换机VTP配置【实验目的】1、掌握VTP的配置。
2、掌握三层交换机的配置。
【实验任务】1.配置两个VLAN:VLAN2、VLAN 3并为其分配静态成员。
2.测试VLAN分配结果。
3. 通过三层交换机VLAN网关的配置,可实现跨VLAN的相互访问。
【实验设备】Cisco三层交换机1台,Cisco二层交换机1台,PC 机6台,连接线若干条。
【实验拓扑图】【实验要求】在交换机S-3550上划分2个VLAN:VLAN2、VLAN3。
两台交换机的端口1为Trunk 口。
交换机S-3550的VLAN、端口和计算机的划分:交换机S-2950的VLAN、端口和计算机的划分:【实验步骤】1、按照拓扑图把相应的设备连接好。
2、配置交换机S3550的VTP模式:Server模式、域名MYVTP、密码CISCO。
3、在交换机S3550上创建VLAN2、VLAN3。
4、把交换机S3550的端口2、3划分到VLAN2中。
5、把交换机S3550的端口4、5划分到VLAN3中。
6、查看S3550已经划分好的VLAN及相应的端口7、把交换机S3550端口1配置为主干道trunk模式8、配置交换机S2950的VTP模式:Client模式、域名MYVTP、密码CISCO9、查看S2950的VLAN划分情况10、把交换机S2950端口2、3划分到VLAN2中11、把交换机S2950端口1配置为主干道trunk模式12、配置各台PC机的IP地址、子网掩码(注意:同一VLAN的PC机必须处于同一个子网内)13、测试各台PC间的连通性(测试可得,同一VLAN的PC可以ping通,但不同VLAN的PC机不可以ping通)14、在交换机S3550上配置三层交换机,分别把VLAN2、VLAN3的网关(即VLAN的IP地址)设置为10.2.0.254/24、10.3.0.254/2415、配置各台PC机的网关(注意:处于哪一个VLAN内的PC机就必须配置其网关为对应VLAN的网关)16、再次测试各台PC间的连通性(测试可得,无论是相同VLAN或者不同VLAN的PC都可以ping通,即可以实现不同VLAN间的通信)。
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信息。
思科交换机的VLAN、TRUNK、VTP配置教程CISCO交换机配置实例(VTP、VLAN、TRUNK、channel) 本文通过实例为大家介绍CISCO交换机的一些常用功能的配置方法,你还在为不知道思科交换机的VLAN、 TRUNK 、VTP 配置教程而烦恼么?接下来是小编为大家收集的思科交换机的VLAN、TRUNK 、VTP 配置教程,希望能帮到大家。
思科交换机的VLAN、 TRUNK 、VTP 配置教程:1. 配置 CISCO 二层交换机的IP 地址(catalyst 2950 为例)SW1(config)#int vlan 1 //进入管理接口interface vlan 1SW1(config-if)#ip address 11.1.1.2 255.255.255.0 //配置IP 地址SW1(config-if)#no shutdownSW1(config-if)#exitSW1(config)#ip default-gateway 11.1.1.1 //配置网关,可通过show run 查查看所配置的 IP 地址:SW1#show int vlan 1Vlan1 is up, line protocol is upHardware is CPU Interface, address is 0008.20ff.6400 (bia 0008.20ff.6400)Internet address is 11.1.1.2/242.配置交换机的端口速度和双工(Speed and Duplex)SW1(config)#interface fa0/1SW1(config-if)#speed {10 | 100 | auto} //10M/100M/自适应SW1(config-if)#duplex {auto | full | half} //自适应/全双工/半双工一般情况下,交换机两端的端口速度和双工要匹配,这样通信质量才能得到保证,在相同厂家的产品(比如说Cisco 的交换机互连)中端口协商不用配置一般不会有什么问题,可以通过show interface 查看端口的速度和双工。
VLAN中继协议(VTP)实验一、 实验目的1、掌握Trunk和VTP 工作原理2、学习配置Trunk的命令和步骤3、学习配置VTP命令和步骤4、STP选举的干涉和端口状态二、 实验要求1、拓扑与地址规划;2、Trunk基本配置和VTP配置3、验证Trunk和VTP配置并给出配置清单4、Cisco Packet Tracer5.3三、 实验设计的相关知识及原理1、TrunkTRUNK是端口汇聚的意思,通过配置软件的设置,将2个或多个物理端口组合在一起成为一条逻辑的路径从而增加在交换机和网络节点之间的带宽,将属于这几个端口的带宽合并,给端口提供一个几倍于独立端口的独享的高带宽。
Trunk是一种封装技术,它是一条点到点的链路,链路的两端可以都是交换机,也可以是交换机和路由器,还可以是主机和交换机或路由器。
基于端口汇聚(Trunk)功能,允许交换机与交换机、交换机与路由器、主机与交换机或路由器之间通过两个或多个端口并行连接同时传输以提供更高带宽、更大吞吐量, 大幅度提供整个网络能力。
2、VTPVTP是VLAN中继协议,也被称为虚拟局域网干道协议。
它是思科私有协议。
作用是十几台交换机在企业网中,配置VLAN工作量大,可以使用VTP协议,把一台交换机配置成VTP Server, 其余交换机配置成VTP Client,这样他们可以自动学习到server 上的VLAN 信息。
VTP有三种工作模式:VTP Server、VTP Client 和 VTP Transparent。
新交换机出厂时的默认配置是预配置为VLAN1,VTP 模式为服务器。
(1)服务器模式不提供VTP消息不学习VTP消息转发VTP消息可以添加、删除和更改VLAN,只在本地有效 VLAN信息写入NVRAM 新交换机出厂时的默认配置是预配置为VLAN1,VTP 模式为服务器。
(2)客户机模式请求VTP消息学习相同域名的VTP消息转发相同域名的VTP消息不可以添加、删除和更改VLAN VLAN信息不会写入NVRAM(3)透明模式不提供VTP消息不学习VTP消息转发VTP消息可以添加、删除和更改VLAN,只在本地有效 VLAN信息写入NVRAM 新交换机出厂时的默认配置是预配置为VLAN1,VTP 模式为服务器。
CISCO交换机VTP配置参考实例作者: 佚名, 出处:IT专家网论坛,责任编辑: 白志飞,2009-12-02 07:01在配置VTP之前,首先要明白几点:在配置VTP之前,首先要明白几点:1、Vtp实现单点访问控制vlan信息的作用。
是CISCO私有协议。
2、Vtp工作在OSI参考模型第二层,组播地址:01-00-0c-cc-cc-cc。
3、Vtp 使用条件:交换机直连、同域(domain),同密(Password),拥有中继端口(trunk)。
4、Vtp 模式:Vtp Server :交换机默认为Server模式,在域中至少有一台交换机处于此模式。
Client、Transparent 此模式在VTP 不同版本表现是不同的。
5、Vtp 消息类型:每300秒发送一次,当网络拓扑发生变化时也会发送。
汇总通告:包含目前的VTP域名与配置修改编号。
配置修改编号的范围(0~2^32 - 1)。
子集通告:包含vlan 配置的详细信息。
通告请求:发送前提为,1、交换机重起后 2 、VTP 域名发生变化后3 、交换机接受到修改配置编号比自己高的汇总通告。
6、交换机修改配置编号重设为0的方法:a、更改交换机的域名b、将交换机的模式该为透明模式后再该为其他的模式。
7、Vtp 修剪在服务器上打vtp pruning 可减少不必要的广播。
如图,交换机Switch0的f0/1、f0/2、f0/3分别与三台子交换机相连,在这里我们把Switch0做为Vtp Server,剩下三台做为Vtp Client来配置整个网络,三台交换机f0/24分别与三台PC相连,依次为Vlan10、Vlan20、Vlan30。
具体命令如下:Switch0配置Switch#configSwitch(config)#int range f0/1-3Switch(config-if-range)#switchport mode trunkSwitch(config-if-range)#endSwitch#vlan databaseSwitch(vlan)#vtp domain qqgzsSwitch(vlan)#vtp password qqgzsSwitch(vlan)#vlan 10Switch(vlan)#vlan 20Switch(vlan)#vlan 30Switch1配置:Switch(config)#int f0/1Switch(config-if)#switchport mode trunk Switch(config-if)#endSwitch#vlan databaseSwitch(vlan)#vtp domain qqgzsSwitch(vlan)#vtp password qqgzsSwitch(vlan)#vtp clientSwitch(vlan)#exitSwitch#configSwitch(config)#int f0/24Switch(config-if)#switchport access vlan 10 Switch2与Switch3配置类似,在这里不再多说。
在SwA上进行配置如下(配置服务器端):SwA>enableSwA#vlan databaseSwA(vlan)#SwA(vlan)#vlan 2 name TztA //创建vlan 2 名称为TztAVLAN 2 added:Name: TztASwA(vlan)#vlan 3 name TztB //创建vlan 3 名称为TztBVLAN 3 added:Name: TztBSwA(vlan)#vtp domain //进入vtp配置模式,并配置vtp域名Changing VTP domain name from NULL to SwA(vlan)#vtp password 123 //配置vtp服务器端密码,此密码用于客户端核对Setting device VLAN database password to 123SwA(vlan)#vtp server //配置成vtp服务器端,默认也是开启的Device mode already VTP SERVER.SwA(vlan)#exitAPPLY completed.Exiting....SwA#show vlan //查看vlan配置情况,如下:SwA#show vlanVLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/2, Fa0/4, Fa0/5, Fa0/6Fa0/7, Fa0/8, Fa0/9, Fa0/11Fa0/12, Fa0/13, Fa0/14, Fa0/15Fa0/16, Fa0/17, Fa0/18, Fa0/19Fa0/20, Fa0/21, Fa0/22, Fa0/23Fa0/24, Gig1/1, Gig1/22 TztA active3 TztB active1002 fddi-default act/unsup1003 token-ring-default act/unsup1004 fddinet-default act/unsup1005 trnet-default act/unsupVLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 0 02 enet 100002 1500 - - - - - 0 03 enet 100003 1500 - - - - - 0 01002 fddi 101002 1500 - - - - - 0 0--More—在SwB上进行配置如下(配置客户端):Switch#vlan database% Warning: It is recommended to configure VLAN from config mode,as VLAN database mode is being deprecated. Please consult userdocumentation for configuring VTP/VLAN in config mode.Switch(vlan)#vtp domain Domain name already set to .Switch(vlan)#vtp password 123Setting device VLAN database password to 123Switch(vlan)#vtp clientSetting device to VTP CLIENT mode.Switch(vlan)#exitAPPLY completed.Exiting....Switch#show vlan //显示SwB的vlan配置情况,可以看见,我并没有配置TztA和TztB在SwB上,但是这里已经有了这两个vlan,这就是vtp的功能VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/1, Fa0/3, Fa0/5, Fa0/6Fa0/7, Fa0/8, Fa0/9, Fa0/11Fa0/12, Fa0/13, Fa0/14, Fa0/15Fa0/16, Fa0/17, Fa0/18, Fa0/19Fa0/20, Fa0/21, Fa0/22, Fa0/23Fa0/24, Gig1/1, Gig1/22 TztA active3 TztB active1002 fddi-default act/unsup1003 token-ring-default act/unsup1004 fddinet-default act/unsup1005 trnet-default act/unsupVLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 0 02 enet 100002 1500 - - - - - 0 03 enet 100003 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 0 0Switch#//接下来若要实现交换机之间互访,设置交换机成trunk模式即可。
VTP协议及其配置-电脑资料VTP协议(VLAN Trunk Protocol)是Cisco私有协议作用:从一个控制点(也就是VTP中的服务器)维护整个企业网上VLAN添加、删除和重命名等工作VTP域的组成:相同域名,必须通过Trunk相互连接,一组交换机VTP的运行模式有3种:——服务器模式(server)提供VTP消息:包括VLAN ID和名字信息学习相同域名的VTP消息转发相同域名的VTP消息可以添加删除更改VLAN——客户端模式(client)请求VTP消息学习相同域名的VTP消息转发相同域名的VTP消息不可以添加删除更改VLAN——透明模式(Transparent)不提供VTP消息不学习VTP消息转发VTP消息可以添加删除更改VLAN,只在本地生效VTP通告1、客户机的通告请求——获取VLAN信息条件:交换机重启;VTP域名变更;交换机接收到了配置修订号大的汇总通告2、服务器的通告响应——发送VLAN信息汇总通告:用于通知邻接的交换机目前VTP域名和配置修订编号;每隔300秒一次或配置改变时发送通告子集通告:包含VLAN的详细信息注意:VTP通告使用组播地址发送,地址为01-00-0c-cc-cc-cc只能通过中继端口(串口)传送VTP消息通过VLAN 1传送VTP版本1、version 1:一个VTP透明传输的交换机,需要检查VTP版本号和域名是否匹配,匹配时才转发2、version 2:再转发VTP信息时,不检查版本号和域名相关配置命令:#switchport mode trunk ——“全局”设置Trunk链路#vtp domain 域名——“VLAN数据库”,创建VTP域#vtp mode server | client | transparent ——2950系列配置VTP 模式#vtp server | client | transparent ——3640系列配置VTP模式#vtp password 密码——配置VTP口令#vtp pruning ——配置VTP修建#vtp version 2 ——2950配置VTP版本#vtp v2-mode ——3640配置VTP版本#show vtp status例拓补图:具体配置步骤:【交换机A】A(config)#interface f0/10A(config-if)#switchport mode trunk ——设置该端口为串口模式。
动态NAT配置(2009-03-27 19:57:50)标签:动态nat杂谈分类:Cisco交换路由实验一、R1配置:Router>enableRouter#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname R1R1(config)#R1(config)#end%SYS-5-CONFIG_I: Configured from console by consoleR1#copy running-config startup-configDestination filename [startup-config]?Building configuration...[OK]R1#configure tEnter configuration commands, one per line. End with CNTL/Z.R1(config)#interface fastEthernet 0/0R1(config-if)#ip address 192.168.1.254 255.255.255.0R1(config-if)#no shutdown%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state toupR1(config-if)#exitR1(config)#interface serial 2/0R1(config-if)#ip address 202.96.1.1 255.255.255.0R1(config-if)#clock rate 64000R1(config-if)#no shutdownR1(config)#router ripR1(config-router)#version 2R1(config-router)#no auto-summaryR1(config-router)#network 202.96.1.0R1(config)#ip nat pool TIANXUAN 202.96.1.3 202.96.1.100 netmask 255.255.255.0 R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255R1(config)#ip nat inside source list 1 pool TIANXUANR1(config)#interface fastEthernet 0/0R1(config-if)#ip nat insideR1(config-if)#exitR1(config)#interface serial 2/0R1(config-if)#ip nat outsideR1(config-if)#exitR1(config)#^Z%SYS-5-CONFIG_I: Configured from console by consoleR1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not set2.0.0.0/24 is subnetted, 1 subnetsR 2.2.2.0 [120/1] via 202.96.1.2, 00:00:15, Serial2/0C 192.168.1.0/24 is directly connected, FastEthernet0/0C 202.96.1.0/24 is directly connected, Serial2/0R1#show ip nat statisticsTotal translations: 2 (0 static, 2 dynamic, 0 extended)Outside Interfaces: Serial2/0Inside Interfaces: FastEthernet0/0Hits: 22 Misses: 2Expired translations: 0Dynamic mappings:-- Inside Sourceaccess-list 1 pool TIANXUAN refCount 2pool TIANXUAN: netmask 255.255.255.0start 202.96.1.3 end 202.96.1.100type generic, total addresses 98 , allocated 2 (2%), misses 0R1#show ip nat translationsPro Inside global Inside local Outside local Outside global --- 202.96.1.3 192.168.1.1 --- ------ 202.96.1.4 192.168.1.2 --- ------ 202.96.1.5 192.168.1.3 --- ------ 202.96.1.6 192.168.1.4 --- ---R1#debug ip natIP NAT debugging is onR1#debug ip natIP NAT debugging is onR1#NAT: s=192.168.1.1->202.96.1.6, d=2.2.2.2[5]NAT*: s=2.2.2.2, d=202.96.1.6->192.168.1.1[5]NAT: s=192.168.1.1->202.96.1.6, d=2.2.2.2[5]NAT*: s=2.2.2.2, d=202.96.1.6->192.168.1.1[5]NAT: s=192.168.1.1->202.96.1.6, d=2.2.2.2[5]NAT*: s=2.2.2.2, d=202.96.1.6->192.168.1.1[5]NAT: s=192.168.1.1->202.96.1.6, d=2.2.2.2[5]NAT*: s=2.2.2.2, d=202.96.1.6->192.168.1.1[5]R1#NAT: s=192.168.1.1->202.96.1.6, d=2.2.2.2[5]NAT*: s=2.2.2.2, d=202.96.1.6->192.168.1.1[5]NAT: s=192.168.1.1->202.96.1.6, d=2.2.2.2[5]NAT*: s=2.2.2.2, d=202.96.1.6->192.168.1.1[5]NAT: s=192.168.1.1->202.96.1.6, d=2.2.2.2[5]NAT*: s=2.2.2.2, d=202.96.1.6->192.168.1.1[5]NAT: s=192.168.1.1->202.96.1.6, d=2.2.2.2[5]NAT*: s=2.2.2.2, d=202.96.1.6->192.168.1.1[5]NAT: s=192.168.1.1->202.96.1.6, d=2.2.2.2[5]NAT*: s=2.2.2.2, d=202.96.1.6->192.168.1.1[5]NAT: s=192.168.1.1->202.96.1.6, d=2.2.2.2[5]NAT*: s=2.2.2.2, d=202.96.1.6->192.168.1.1[5]NAT: s=192.168.1.1->202.96.1.6, d=2.2.2.2[5]NAT*: s=2.2.2.2, d=202.96.1.6->192.168.1.1[5]二、R2配置:Router>enableRouter#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R2R2(config)#R2(config)#end%SYS-5-CONFIG_I: Configured from console by consoleR2#copy running-config startup-configDestination filename [startup-config]?Building configuration...[OK]R2(config)#interface serial 3/0R2(config-if)#ip address 202.96.1.2 255.255.255.0R2(config-if)#no shutdownR2(config)#interface loopback 0R2(config-if)#ip address 2.2.2.2 255.255.255.0R2(config)#router ripR2(config-router)#version 2R2(config-router)#no auto-summaryR2(config-router)#network 2.0.0.0R2(config-router)#network 202.96.1.0R2#ping 2.2.2.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 16/16/16 msR2#ping 202.96.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 202.96.1.1, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 msR2#ping 192.168.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds: .....Success rate is 0 percent (0/5)三、小结核心:R1(config)#ip nat pool TIANXUAN 202.96.1.3 202.96.1.100 netmask 255.255.255.0 R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255R1(config)#ip nat inside source list 1 pool TIANXUANR1(config)#interface fastEthernet 0/0 R1(config-if)#ip nat insideR1(config-if)#exitR1(config)#interface serial 2/0R1(config-if)#ip nat outsideR1(config-if)#exit动态地址池的IP地址应为合法地址,可能实际中不可能申请了这么多的IP地址。
配置Cisco VLAN、VLAN Trunk、VTP和STPVLAN、VLAN Trunk、VTP和STP在交换机的配置中是非常重要的内容,作为初级认证的CCNA考试也对它们的配置提出了基本的要求。
本节的实验就是有关这几项配置的基本操作。
1.实验目的通过本实验,读者可以掌握以下技能:配置VLAN;通过VLAN Trunk配置跨交换机的VLAN;配置VTP;配置STP;查看上述配置项目的相关信息。
2.设备需求本实验需要以下设备:Cisco Catalyst 1900系列交换机2台,型号不限,企业版软件,本实验中使用了1912交换机;交叉线序网线1条;1台终端服务器,如Cisco 2509路由器,及用于反向Telnet的相应电缆;1台带有超级终端程序的PC机,以及Consoie电缆及转接器。
3. 线缆连接及配置说明如图3-3所示,用交叉网线把SW1交换机的Fast Ethernet0/26端口和SW2交换机的Fast Ethernet0/26端口连接起来。
图示中略去了作为终端服务器的路由器和作为超级终端的PC机。
4. 实验配置及监测结果电缆连接完成后。
给所有设备加电,开始进行实验。
监测清单3-3记录了本实验的操作。
第1段:在SW1和SW2上配置VTPSW1912#conftEnter configuration commands,one per line.End with CNTL/ZSW1912(config)#hostn SW1SW1(config)#vtp?client VTP clientdomain Set VTP domanin namepassowrd Set VTP passwordpruning VTP pruningserver VTP servertransparent VTP transparenttrap VTP trapSW1(config-if)#tnmk onSW1(config-if)#( Ctrl+Shift+6,x )Term_Server>2[Resuming connection 2 to switch2...]>en#conftEnter configuration commands,one per line,End with CNTL/Z (config)#hostn SW2SW2(config)#vtp domain ciscoSW2(config)#vtp clientSW2(config)#第2段:配置VLAN Trunk( Ctrl+Shift+6,x )Term_Server>2[Resuming connection 2 to switch2...]SW1(config)#int fa0/26SW1(config-if)#trunk?auto Set DISL state to AUTOdesirable Set DISL state to DESIRABLE nonegotiate Set DISL state to NONEGOTIATE off Set DISL state to OFFon Set DISL state to ONSW1(config-if)#trunk onSW1(config-if)#(Ctrl+Shift+6,x)Term_Server>2[Resuming connection 2 to switch2...]SW2(config)#int fa0/26SW2(config-if)#trunk?SW2(config-if)#SW2#sh trunk aDISL state:On,Trunking:on,Encapsulation type:ISLSW2#sh trunk bDISL state:Off,Trunking:Off,Encapsulation type:Unknown SW2#sh trunk a allowed-vlans1-1005第3段:配置VLAN和查看VTP信息Term_Server>1[Resuming connection 1to switch1...]SW1(config)#vlan10name DEPT1SW1(config)#vlan11name DEPT2SW1(config)#vlan 12name DEPT3SW1(config)#vlan 13name DEPT4SW1(config)#SW1#sh vlanVLAN Name Status Ports-------------------------------------1default Enabled1-12,AUI,A,B10DEPT1Enabled11DEPT2Enabled12DEPT3Enabled13DEPT4Enabled1002 fddi-default Suspended1003 fddi-default Suspended1004 fddi-default Suspended1005 fddi-default Suspended-----------------------------VLAN Type SAID MTU Parent RingNo BridgeNo Stp Trans1Trans2 ---------------------------------------------------------------------1Ethernet100001 1500000Unkn 1002100310Ethernet100010 1500011Unkn 0011Ethernet100011 1500011Unkn 0012Ethernet100012 1500011Unkn 0013Ethernet100013 1500011Unkn 001002 FDDI101002 1500000Unkn110031003 Token-Ring101003 1500100510Unkn110021004 FDDI-Net101004 1500001IEEE001005 Token-Ring-Net101005 1500001IEEE00---------------------------------------------------------------------SW1#Term_Server>2[Resuming connection 2 to switch2...]SW2#sh vlanVLAN Name Status Ports------------------------------------------1default Enabled1-12,AUI,A,B10DEPT1Enabled11DEPT2Enabled12DEPT3Enabled13DEPT4Enabled1002 fddi-default Suspended1003 token-ring-defau Suspended1004 fddinet-default Suspended1005 fddi-default Suspended...(有关VLAN的具体信息,如SW1,省略)SW2#sh vtpVTP version:1Configuration revision:4Maximum VLANs supported locally:1005Number of existing VLANs:9VTP domain nameVTP passwordVTP operating mode:ClientVTP pruning mode: DisabledVTP traps generation: EnabledConfigruration last modified by:192.168.1.1 at 00-00-0000 00:00:00SW2#(第4段:配置端口的VLAN归属并查看VLAN信息)Term_Server>1[Resuming connection 1 to switch 1 ... ]SW1#conftEnter configuration commands, one per line. End with CNTL/ZSW1(config)#inte0/1SW1(config-if)#vlan-membership ?dynameic Set VLAN membership type as dynamicstatic Set VLAN membership type as staticSW1(config-if)#vlan-membership static 10SW1(config-if)#int e0/2SW1(config-if)#vlan-membership static 11SW1(config-if)#int e0/3SW1(config-if)#vlan-membership static 12SW1(config-if)#int e0/10SW1(config-if)#vlan-membership static 10SW1(config-if)#SW1#sh vlanVLAN Name Status Ports--------------------------1 default Enabled4-9, 11-12, AUI, A, B10 DEPT1Enabled1,1011 DEPT2Enabled 212 DEPT3Enabled 313 DEPT4Enabled1002 fddi-default Suspended1003 token-ring-defau Suspended1004 fddinet-default Suspended1005 trnet-default Suspended-----------------------------VLAN Type SAID MTU Parent RingNoBridgeNoStp TranslTrans2 ----------------------------------1Ethernet100001 1500000Unkn 1002100310Ethernet100010 1500011Unkn 0011Ethernet100011 1500011Unkn 0012Ethernet100012 1500011Unkn 0013Ethernet100013 1500011Unkn 001002 FDDI101002 150000Unkn 110031003 Token-Ring101003 150010Unkn 110021004 FDDI-Net101004 150001IEEE 001005 Token-Ring-Net101005 150001IEEE 00----------------------SW1#sh vlan 11VLAN Name Status Ports-----------------11DEPT2Enabled 2--------------VLAN Type SAID MTU Parent RingNo BridgeNo Stp Trans1 Trans2 ------------11Ethernet100011 1500011Unkn00-------------------SW1#sh vlan-membershipPort VLAN Membership Type Port VLAN Membership Type---------- ------------110Static211Static312Static41Static51Static61Static71Static81Static91Static1010Static111Static121StaticAUI1StaticA1StaticB1Static第5段:查看STP信息SW1#sh spantree 10VLAN1O is executing the IEEE compatible Spanning Tree ProtocolBridge Identifier has priority 32768,address 0004.DD4E.9C81Configured hello time 2, max age 20, forward delay 15Current root has priorityRoot port is FastEthernet0/26,cost of root path is 10Topology change flag not set, detected flag not setTopology changes 1, last topology change occured 0d00h04ml0s agoTimes: hold 1, topology change 8960hello 2, max age 20, forward delay 15Timers: hello 2, topology change 35, notification 2Port Ethernet 0/1 of VLANIO is ForwardingPort path cost 100, Port priority 128Designated root has priority 32768, address 0004.27C4.2401Designated bridge has priority 32768, address 0004.DD4E.9C81Designated port is 1, path cost 10Timers: message age 20, forward delay 15, hold 1Port Ethernet 0/10 of VLANIO is ForwardingPort path cost 100, Port priority 128Designated root has priority 32768,address 0004.27C4.2401Designated bridge has priority 32768,address 0004.DD4E.9C81Designated port is 10, path cost 10Timers: message age 20, forward delay 15, hold 1Port FastEthernet 0/26 of VLANIO is ForwardingPort path cost 10, Port priority 128Designated root has priority 32768,address 0004.27C4.2401Designated bridge has priority 32768, address 0004.27C4.2401Designated port is 26, path cost 0Timers: message age 20, forward delay 15, hold 1SW1#SW1#conftEnter configuration commands, one per line. End with CNTL/ZSW1(config)#no spantree 10SW1(config)#SW1#sh spantree 10Error>r:-STP is not enabled for VLAN 10SW1#(1)第1段是对VTP进行配置。
Cisco交换机vtp配置实验环境:cisco Packet Tracer5.3拓扑图:1.Ds的配置Switch#conf tEnter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname Ds1Ds1(config)#vtp domain jvtcChanging VTP domain name from NULL to jvtcSwitch(config)#vtp mode serverDs1(config)#interface gigabitEthernet 0/1Ds1(config-if)#switchport mode accessDs1(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to upDs1(config-if)#exitDs1#show vtp statusVTP Version : 2Configuration Revision : 0Maximum VLANs supported locally : 1005Number of existing VLANs : 5VTP Operating Mode : ServerVTP Domain Name : jvtcVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0x97 0x15 0xF7 0x52 0x62 0x24 0x0B 0xECConfiguration last modified by 0.0.0.0 at 0-0-00 00:00:00Local updater ID is 0.0.0.0 (no valid interface found)Ds1#copy running-config startup-configDestination filename [startup-config]?Building configuration...[OK]Ds1#2.As1的配置Switch>enSwitch#conf tEnter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname As1As1(config)#interface gigabitEthernet 1/1As1(config-if)#switchport mode trunkAs1(config-if)#exitAs1(config)#interface gigabitEthernet 1/2As1(config-if)#switchport mode trunkAs1(config-if)#exitAs1(config)#vtp domain jvtcDomain name already set to jvtc.As1(config)#vtp mode clientSetting device to VTP CLIENT mode.As1(config)#exitAs1#show vtp statusVTP Version : 2Configuration Revision : 0Maximum VLANs supported locally : 255Number of existing VLANs : 5VTP Operating Mode : ClientVTP Domain Name : jvtcVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0x97 0x15 0xF7 0x52 0x62 0x24 0x0B 0xECConfiguration last modified by 0.0.0.0 at 0-0-00 00:00:00As1#copy running-config startup-configDestination filename [startup-config]?Building configuration...[OK]As1#3.As2的配置Switch>enSwitch#conf tEnter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname As1As1(config)#interface gigabitEthernet 1/1As1(config-if)#switchport mode trunkAs1(config-if)#exitAs1(config)#vtp domain jvtcDomain name already set to jvtc.As1(config)#vtp mode clientSetting device to VTP CLIENT mode.As1(config)#exitAs1#show vtp statusVTP Version : 2Configuration Revision : 0Maximum VLANs supported locally : 255Number of existing VLANs : 5VTP Operating Mode : ClientVTP Domain Name : jvtcVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0x97 0x15 0xF7 0x52 0x62 0x24 0x0B 0xECConfiguration last modified by 0.0.0.0 at 0-0-00 00:00:00As2#copy running-config startup-configDestination filename [startup-config]?Building configuration...[OK]As2#4.vlan中继查看Ds1#vlan database% Warning: It is recommended to configure VLAN from config mode,as VLAN database mode is being deprecated. Please consult user documentation for configuring VTP/VLAN in config mode.Ds1(vlan)#vlan 10VLAN 10 added:Name: VLAN0010Ds1(vlan)#vlan 20VLAN 20 added:Name: VLAN0020Ds1(vlan)#vlan 30VLAN 30 added:Name: VLAN0030Ds1(vlan)#vlan 40VLAN 40 added:Name: VLAN0040Ds1(vlan)#exitAPPLY completed.Exiting....As1#show vtp statusVTP Version : 2Configuration Revision : 4Maximum VLANs supported locally : 255Number of existing VLANs : 9VTP Operating Mode : ClientVTP Domain Name : jvtcVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0x4A 0xDC 0x4A 0x49 0x15 0xD9 0x91 0xF7Configuration last modified by 0.0.0.0 at 3-1-93 00:42:47#As2#show vtp statusVTP Version : 2Configuration Revision : 4Maximum VLANs supported locally : 255Number of existing VLANs : 9VTP Operating Mode : ClientVTP Domain Name : jvtcVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0x4A 0xDC 0x4A 0x49 0x15 0xD9 0x91 0xF7Configuration last modified by 0.0.0.0 at 3-1-93 00:42:47As2#。