关于网络:思科交换机命令大全含巡检命令网工建议收藏

2次阅读

共计 4117 个字符,预计需要花费 11 分钟才能阅读完成。

思科交换机根本配置命令

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-config

switch#delete flash: vlan.dat

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

switch(config)#interface fastethernet0/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 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                           查看 vlan

switch#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 工作状态

正文完
 0