思科交换机命令大全,含巡检命令,网工建议收藏!
  KDk97yxRQlQU 2023年11月02日 51 0

思科交换机基本配置命令

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

switch(config-line)#password xx 设置登录口令

switch(config-line)#login 要求口令验证

控制台口令

switch(config)#line

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>

switch(config)#no spanning-tree vlan priority 将交换机的优先级恢复默认值(基于vlan)

switch(config-if)#spanning-tree vlan cost<0-200000000>

switch(config-if)#spanning-tree vlan port-prioty<0-255>

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

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
  eo9lmrKcoG9P   2023年12月06日   21   0   0 生成树HCIP阻塞状态字段RSTP
KDk97yxRQlQU