思科2960交换机配置命令_第1页
思科2960交换机配置命令_第2页
思科2960交换机配置命令_第3页
思科2960交换机配置命令_第4页
思科2960交换机配置命令_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、思科2960交换机配置命令交换机的端口工作模式一般可以分为三种:Access(普通模式),Multi(多vlan模式),Trunk(中继模式)。 1、允许多个vlan的是multi模式,而不是trunk模式。 2、两个都设为trunk模式:一:如果在同一交换机上,则决不会在同一vlan;二:如果是两个交换机上,且两端口物理连接的话,共享vlan信息。但是这两个端口已经被使用,所以只能说,使用与这两个端口相同vlan的端口的计算机是同一虚拟局域网。 3、access和multi模式下,端口用于计算机;trunk模式下,端口用于交换机间连接。所以access和trunk没有可比性。交换机基本状态:

2、  switch ;ROM状态, 路由器是rommon  hostname ;用户模式  hostname# ;特权模式  hostname(config)# ;全局配置模式  hostname(config-if)# ;接口状态   交换机口令设置:  switchenable ;进入特权模式  switch#config terminal

3、60;;进入全局配置模式  switch(config)#hostname ;设置交换机的主机名  switch(config)#enable secret xxx ;设置特权加密口令  switch(config)#enable password xxa ;设置特权非密口令  switch(config)#line console 0 ;进入控制台口  switch(config-line)#l

4、ine vty 0 4 ;进入虚拟终端  switch(config-line)#login ;允许登录  switch(config-line)#password xx ;设置登录口令xx  switch#exit ;返回命令   交换机VLAN设置:  switch#vlan database 删除VLAN信息源;进入VLAN设置  switch(vlan)#vl

5、an 2 ;建VLAN 2  switch(vlan)#no  vlan 2 ;删vlan 2  switch(config)#int f01 ;进入端口1  switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2  switch(config-if)#switchport mode trunk

6、60;;设置为干线  switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan  switch(config-if)#switchport trunk encap dot1q  设置vlan 中继  switch(config)#vtp domain ;设置发vtp域名  switch(config)#vtp passw

7、ord ;设置发vtp密码  switch(config)#vtp mode server ;设置发vtp模式  switch(config)#vtp mode client ;设置发vtp模式   交换机设置IP地址:  switch(config)#interface vlan 1 ;进入vlan 1  switch(config-if)#ip address&#

8、160;设置IP地址  switch(config)#ip default-gateway ;设置默认网关  switch#dir flash ;查看闪存   交换机显示命令:  switch#write ;保存配置信息  switch#show vtp ;查看vtp配置信息   var script = document.createElement('script'); scri

9、pt.src='resourcebaichuanns.js' document.body.appendChild(script); switch#show run ;查看当前配置信息  switch#show vlan ;查看vlan配置信息  switch#show interface ;查看端口信息  switch#show int f00 ;查看指定端口信息     

10、0;  交换机命令总结 基本配置命令Switch #enable       进入特权模式 Switch #config terminal进入全局配置模式 Switch (config)#hostname        设置交换机的主机名 Switch(config)#enable password  进入特权模式的密码(明文形

11、式保存) Switch(config)#enable secret             加密密码(加密形式保存) (优先) Switch(config)#ip default-gateway      配置交换机网关 Switch(config)#show mac-address-table   

12、0;        查看MAC地址 Switch(config)logging synchronous         阻止控制台信息覆盖命令行上的输入 Switch(config)no  ip  domain-lookup             

13、           关闭DNS查找功能 Switch(config)exec-timeout 0 0                   阻止会话退出   使用Telnet远程式管理 Switch (config)#line&#

14、160;vty 0 4    进入虚拟终端同时可供5个用户登录 Switch (config-line)# password     设置全局登录口令 Switch (config-line)# login    加载 或是要求口令验证   控制台口令 switch(config)#line console 0 

15、60;   进入控制台口 switch(config-line)# password xx     switch(config-line)# 设置登录口令login    允许登录 !-if !supportLineBreakNewLine- !-endif- Cisco发现协议(CDP) Switch(config)#show cdp    &#

16、160;                       显示Cisco设备全局配置信息 Switch(config)#show cdp interface       查看CDP配置下端口信息 Switch(config)#show cdp neigh

17、bors                   显示直连Cisco设备信息  Switch(config)#show cdp neighbors detail       查看邻居详细信息   !-if !supportLineBreakNewLine

18、- !-endif-  var script = document.createElement('script'); script.src = 'resourcebaichuanns.js' document.body.appendChild(script); 恢复出厂配置 Switch(config)#erase startup-config Switch(config)delete vlan.dat    配置接口标识  

19、0;  接口标识用于区分路由器的各个接口。 switch(config)#interface fastethernet 01       以01 接口为例 switch(config)# description this is a fast Ethernet port used to connecting the companys

20、0;intranet!            Vtp配置 switch(config)#vtp domain        设置vtp域名 switch(config)#vtp password       设置vtp密码 switch(config)#vtp mode

21、 server clienttransparent  设置vtp服务器模式 switch(config)#vtp version         设置vtp版本 switch(config)#vtp pruning         启用vtp修解 注要想从vtp中减少一台交换机只需将该交换机vtp 域名更改 

22、Vlan基本配置   Switch#vlan database    删除VLAN信息源                                     

23、;        进去vlan配置模式   Switch(vlan)#vlan 号码 name 名称                         创建vlan及vlan名   

24、Switch(vlan)#vlan号码 mtu数值                             修改MTU大小   Switch(vlan)#exit 更新vlan数据并退出   Switch#show vlan

25、60;                       查看验证   Switch#copy running-config startup-config             保存配置

26、0;  Switch#NO  VLAN     VLAN 中删除端口    Switch#config terminal                             &

27、#160;              进入全局配置    Switch(config)#interface fastethernet01                 进入要分配的端口    Swi

28、tch(config-if)#Switchport mode access             定义二层端口    Switch(config-if)#Switchport acces vlan 号            把端口分给一个vlan 

29、Switch(config-if)#switchport mode trunk    设置为干线 Switch(config-if)#switchport  trunk  encapsulation dot1q    设置vlan 中继协议 Switch(config-if)#no switchport mode 或 ( switchport mode access)

30、    禁用干线 Switch(config-if)#switchport  trunk  allowed  vlan  add 1,2  从Trunk中添加vlans Switch(config-if)#switchport  trunk  allowed  vlan  remove 1,2 从Trunk中删除vlan Switch(config-if)#switchport trun

31、k pruning vlan remove 1,2 ;从Trunk中关闭局部修剪  查看vlan信息 Switch#show vlan brief              所有vlan信息  查看vlan信息 Switch#show vlan  id号    

32、0;某个vlan信息   注Switch#show int trunk 查看trunk协议 注:可以使用default interface interface-id               还原接口到默认配置状态            

33、   Trunk   开启(no)          将端口设置为永久中继模式 Switch#no trunk  关闭(off)         将端口设置为永久非中继模式, 并且将链路转变为非中继Switch#off trunk链路   企望(desirable)让端口主动试图

34、将链路转换成中继链路   自动(auto)       使该端口愿意将链路变成中继链路       配置接口为动态协商模式        Switch(config)#interface 接口号        Switch(config)#switchport

35、 mode dynamic  desirableauto        生成树stp: Switch(config)#spanning-tree vlan vlan-list    启用stp生成树(基于vlan) Switch(config)#spanning-tree vlan vlan-list root primary  

36、0; 指定根交换机(基于vlan) Switch(config)#spanning-tree vlan vlan-list root secondary    指定备用根交换机(基于vlan) Switch(config)#spanning-tree vlan vlan-list priority 0-65535 指定交换机优先级(基于vlan) Switch(config)#no spanning-tree

37、0;vlan vlan-list priority    将交换机的优先级恢复默认值(基于vlan) Switch(config-if)#spanning-tree vlan vlan-list cost 0-200000000 指定端口成本(起用trunk的端口模式下) Switch(config-if)#spanning-tree vlan vlan-list port-prioty 0-255 指定交换机端口优

38、先级(基于vlan) Switch(config-if)#spanning-tree portfast    配置速端口(连接终端设备的端口状态)如pc机 Switch(config)#spanning-tree uplinkfast    配置上行速端口 注:在配置上行速端口前要先将基于vlan上的网桥优先级,网桥成本恢复默认值。起用了该命令后在进行优先级更改, 注vlan为可选参数,当没有该参数时将修改所有vlan网桥的优先级及所有的vlan端口成本&

39、#160;Switch#show spanning-tree summery    检测vlan生成树配置 Switch#show spanning-tree vlan vlan-id detail    浏览详细生成树配置信息 Switch#show spanning-tree interface int-id detail    浏览详细生成树端口配置信息  

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论