思科交换机根本配置命令

switch>enable    进入特权模式switch#config terminal    进入全局模式switch(config)#hostname+xxx    设置主机名switch(config)#enable password   明文明码switch(config)#enable secret     密文明码switch(config)#ip default-gateway  设置网关switch#show mac-address-table  查看MAC地址switch(config)#logging synchronous     阻止控制台信息笼罩命令行上的输出switch(config)#no ip domain-lookup          敞开DNS查看性能switch(config)#exec-timeout 0 0                阻止会话退出

应用telnet近程式治理

switch(config)#line vty 0 4    进入虚构终端switch(config-line)#password xx    设置登录口令switch(config-line)#login     要求口令验证

控制台口令

switch(config)#line console 0   进入控制台口switch(config-line)#password xx  switch(config-line)# 设置登录口令login     容许登录

cisco发现协定(cdp)

switch(config)#show cdp    显示cisco设施全局配置信息switch(config)#show cdp interface端口    查看cdp配置下端口信息switch(config)#show cdp neighbors          显示直连cisco设施信息switch(config)#show cdp neighbors detail  查看街坊详细信息 

思科交换机复原出厂配置

switch#erase startup-configswitch#delete flash: vlan.dat

配置接口标识(辨别路由器的各个接口)

switch(config)#interface fastethernet0/1switch(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 xx  设置VTP明码switch(config)#vtp mode server/client/transparent  设置VTP服务模式switch(config)#vtp version     设置VTP版本switch(config)#vtp pruning   设置VTP修解  

vlan根本配置

switch#vlan database                       进入vlan配置模式switch(vlan)#vlan 号码 name 名称       创立vlan及vlan名switch(vlan)#vlan 号码 mtu 数值         批改MTU大小 switch(vlan)#exit                          更新vlan数据并退出switch#show vlan                           查看vlanswitch#copy running-config startup-config       保留配置

vlan中增加删除端口

switch#conf t

switch(config)#interface fastethernet0/1 进入要调配的端口

switch(config-if)#switchport mode access 定义二层端口

switch(config-if)#switchport access vlan号码 把端口发给一个vlan

switch(config-if)#switchport mode trunk 设置为支线

switch(config-if)#switchport trunk encapsulation dotlq 设置vlan中继协定

switch(config-if)#no switchport mode 或 (switchport mode access) 禁用支线

switch(config-if)#switchport trunk allowed vlan add 1,2 从trunk中增加vlans

switch(config-if)#switchport trunk allowed vlan remove1,2 从trunk中删除vlan

switch(config-if)#switchport trunk pruning vlan remove1,2

配置接口为动静协商模式

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-200000000>   指定端口老本(起用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 fastemet0/1-2  将fastemet0/1和0/2口捆绑switch(config-if)#change-group 1 mode on     配置以太通道模式switch(config-if)#port-channel load-batance{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 interface f0/1 switchport  查看无关switchport的配置switch#show cdp neighbors  查看与该设施相邻的cisco设施

CISCO交换机巡检命令

1、show interface stats ;查看交换机所有接口以后接口流量2、show running-config ;查看以后设施配置3、show version ;查看IOS版本信息及设施失常运行工夫4、show clock ;查看设施时钟信息5、show vtp status ;查看交换机vtp配置模式6、show vtp password ;查看交换机vtp配置口令7、show env all ;查看设施温度,电源和风扇运行参数及是否报警8、show inventory ;调取设施外部板卡出厂模块型号及序列号9、show spanning-tree root ;查看交换机生成树根地位10、show cdp neighbors ;查看邻接cisco设施根本信息11、show cdp neighbors detail ;查看邻接cisco设施详细信息12、show interface status ;查看交换机接口状态是否存在errordisable接口disable接口13、show interface summary ;查看交换机所有接口以后接口流量14、show interface | i errors|FastEthernet|GigabitEthernet ;查看接口是否存在大量input或output errors包谬误15、show processes cpu ;查看设施cpu负载16、show processes mem ;查看设施mem负载17、show access-list ;查看访问控制列表配置及匹配数据包数量18、show logging ;查看本机外部日志记录状况19、show ip route ;查看路由表20、show firewall ;查看防火墙的工作模式21、show conn count ;查看防火墙并发数22、show xlate count ;查看防火墙nat工作状态