思科2960交换机配置命令

思科2960交换机配置命令交换机基本状态 switch ROM 状态 路由器是 rommonhostna 用户模式 hostname 特权模式 hostname config 全局配置模式 hostname co 一名技术人员正在

大家好,欢迎来到IT知识分享网。

 

 

 

 

 


配置接口标识     接口标识用于区分路由器的各个接口。
switch(config)#interface fastethernet 0/1      
0/1 接口为例
switch(config)# description this is a fast Ethernet port used to connecting the company’s intranet!  


 

 


 Vtp
配置
switch(config)#vtp domain        
设置vtp域名
switch(config)#vtp password       
设置vtp密码
switch(config)#vtp mode server /client/transparent 
设置vtp服务器模式
switch(config)#vtp version        
设置vtp版本
switch(config)#vtp pruning         
启用vtp修解
:要想从vtp中减少一台交换机只需将该交换机vtp 域名更改
Vlan
基本配置
  Switch#vlan database                                               
进去vlan配置模式
  Switch(vlan)#vlan
号码 name 名称                         创建vlanvlan
  Switch(vlan)#vlan
号码 mtu数值                             修改MTU大小
  Switch(vlan)#exit                                                      
更新vlan数据并推出
  Switch#show vlan                                                    
查看\验证
  Switch#copy running-config startup-config             
保存配置

  NO 删除VLAN

 


VLAN
中添加 删除端口
   Switch#config terminal                                           
进入全局配置
   Switch(config)#interface fastethernet0/1                
进入要分配的端口
   Switch(config-if)#Switchport mode access            
定义二层端口
   Switch(config-if)#Switchport acces vlan
            把端口分给一个vlan

Switch(config-if)#switchport mode trunk    设置为干线
Switch(config-if)#switchport trunk encapsulation dot1q   
设置vlan 中继协议
Switch(config-if)#no switchport mode
( switchport mode access)    禁用干线
Switch(config-if)#switchport trunk allowed vlan add 1
Trunk中添加vlans
Switch(config-if)#switchport trunk allowed vlan remove 1
2 Trunk中删除vlan
Switch(config-if)#switchport trunk pruning vlan remove 1
2 ;从Trunk中关闭局部修剪

 

查看vlan信息 Switch#show vlan brief              所有vlan信息
 
查看vlan信息 Switch#show vlan id     某个vlan信息

 

:Switch#show int trunk 查看trunk协议

注:可以使用default interface interface-id               还原接口到默认配置状态
         
   Trunk
 


开启(no          ——将端口设置为永久中继模式

  关闭(off         ——将端口设置为永久非中继模式, 并且将链路转变为非中继链路
  
企望(desirable——让端口主动试图将链路转换成中继链路

  自动(auto       ——使该端口愿意将链路变成中继链路


   
配置接口为动态协商模式
       Switch(config)#interface
接口号
       Switch(config)#switchport mode dynamic  desirable/auto
 
    



生成树stp
Switch(config)#spanning-tree vlan    
启用stp生成树(基于vlan
Switch(config)#spanning-tree vlan root primary   
指定根交换机(基于vlan
Switch(config)#spanning-tree vlan root secondary   
指定备用根交换机(基于vlan
Switch(config)#spanning-tree vlan priority <0-65535>
指定交换机优先级(基于vlan
Switch(config)#no spanning-tree vlan priority   
将交换机的优先级恢复默认值(基于vlan
Switch(config-if)#spanning-tree vlan cost <0->
指定端口成本(起用trunk的端口模式下)
Switch(config-if)#spanning-tree vlan port-prioty <0-255>
指定交换机端口优先级(基于vlan
Switch(config-if)#spanning-tree portfast   
配置速端口(连接终端设备的端口状态)如pc
Switch(config)#spanning-tree uplinkfast   
配置上行速端口
:在配置上行速端口前要先将基于vlan上的网桥优先级,网桥成本恢复默认值。起用了该命令后在进行优先级更改,
:vlan为可选参数,当没有该参数时将修改所有vlan网桥的优先级\及所有的vlan端口成本
Switch#show spanning-tree summery   
检测vlan生成树配置
Switch#show spanning-tree vlan detail   
浏览详细生成树配置信息
Switch#show spanning-tree interface detail   
浏览详细生成树端口配置信息


以太网通道配置
switch(config)#interface range fasternet0/1 – 2   
fasternet0/10/2 口捆绑
switch(config-if)#channel-group 1 mode on   
配置以太通道模式
switch(config-if)#port-channel load-balance {dst-mac | src-mac}
在链路间实现负载均衡
switch#show etherchannel  1  summary   
查看通道信息
switch#show etherchannel  load-balance   
查看通道信息


交换机显示命令:
switch#show vtp status   
查看vtp配置信息
switch#show running-config   
查看当前配置信息
switch#show vlan   
查看vlan配置信息
switch#show interface   
查看端口信息
switch#show int f0/0   
查看指定端口信息
switch#dir flash:   
查看闪存
switch#show version   
查看当前版本信息
switch#show cdp    cisco
设备发现协议  (可以查看聆接设备)
switch#show cdp traffic   
杳看接收和发送的cdp包统计信息
switch#show cdp neighbors   
查看与该设备相邻的cisco设备
switch#show interface f0/1 switchport                                   
查看有关switchport的配置
switch#show cdp neighbors                             
查看与该设备相邻的cisco设备

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net//viewspace-/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net//viewspace-/

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://haidsoft.com/136785.html

(0)
上一篇 2025-06-25 12:00
下一篇 2025-06-25 12:10

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注微信