当前位置: 首页 > article >正文

思科网络设备命令

一、交换机巡检命令

  1. 接口和流量状态

    • show interface stats:查看所有接口当前流量。
    • show interface summary:查看所有接口当前状态和流量。
    • show interface status:查看接口状态及可能的错误。
    • show interface | include errors | FastEthernet | GigabitEthernet:查看接口错误包信息。
    • show interfaces description:查看接口描述信息,快速了解每个接口的用途。
    • show interfaces transceiver:查看接口收发器信息。
  2. 系统信息和日志

    • show version:查看IOS版本和设备正常运行时间。
    • show clock:查看设备时钟信息。
    • show logging:查看设备的内部日志记录。
    • show post:查看开机自检结果。
    • show tech-support:查看技术支持信息,包含全面的设备状态。
  3. 配置和状态

    • show running-config:查看当前设备配置。
    • show startup-config:查看设备启动时加载的配置。
    • show inventory:查看设备内部模块及序列号。
    • show spanning-tree root:查看生成树根位置。
    • show ip route:查看路由表。
    • show mac address-table:查看MAC地址表。
    • show port-security interface fastethernet 0/1:查看端口安全配置和状态。
    • show vlan brief:查看所有VLAN的概况。
  4. VTP状态

    • show vtp status:查看VTP配置模式。
    • show vtp password:查看VTP密码。
    • show vlan:查看VLAN配置及状态。
  5. CDP与邻居设备信息

    • show cdp neighbors:查看邻近Cisco设备基本信息。
    • show cdp neighbors detail:查看邻近Cisco设备详细信息。
    • show cdp traffic:查看CDP包统计信息。
  6. 环境信息

    • show env all:查看环境参数(温度、电源、风扇状态)。
    • show power inline:查看接口供电状态。
    • show environment:查看设备环境监控。
  7. CPU与内存负载

    • show processes cpu:查看CPU负载。
    • show processes mem:查看内存负载。
    • show memory:查看内存使用情况。
    • show platform:查看设备平台信息及资源情况。

二、交换机基础配置命令

  1. 模式切换

    • 进入特权模式:enable
    • 进入全局配置模式:configure terminal
  2. 设备命名及密码设置

    • 设置主机名:hostname hxsw-001
    • 配置使能口令:enable password cisco
    • 配置加密密码:enable secret cisco
    • 配置控制台口令:line con 0, password cisco, login
    • 配置VTY口令:line vty 0 4, password cisco, login
  3. VLAN配置

    • 创建VLAN:vlan 10 name IT
    • 配置VLAN接口IP:interface vlan 1, ip address 192.168.1.1 255.255.255.0
    • 删除VLAN:no vlan 10
  4. 端口及接口配置

    • 进入某个端口:interface fastethernet 0/1
    • 设置双工模式:duplex full/half/auto
    • 启用接口:no shut
    • 配置端口为接入模式:switchport mode access
    • 配置端口为中继模式:switchport mode trunk
  5. 远程登录配置

    • 设置VTY线:line vty 0 4
    • 设置远程登录密码:password edge
    • 启用远程登录:login
  6. 恢复出厂设置

    • erase startup-config
    • reload
  7. 端口安全配置

    • switchport port-security:启用端口安全。
    • switchport port-security maximum 2:设置最多可以学习2个MAC地址。
    • switchport port-security violation shutdown:设置违规处理方式。
    • switchport port-security mac-address sticky:启用粘性MAC地址学习。

三、路由器基本配置命令

  1. 模式切换

    • 进入特权模式:enable
    • 进入全局配置模式:configure terminal
  2. 设备名称与密码设置

    • 设置设备名称:hostname xxx
    • 设置特权口令:enable password xxx
    • 设置加密特权口令:enable secret xxx
    • 设置控制台口令:
     line con 0
     password xxx
     login
  1. 接口与路由配置
    • 配置接口IP地址:
     interface s0
     ip address xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx
     no shut
  • 静态路由配置:ip route xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx
  • 默认路由配置:ip route 0.0.0.0 0.0.0.0 s0
  • 动态路由配置(按需选择):
  • RIP协议配置
       router rip
       network xxx.xxx.xxx.xxx
       version 2
  • EIGRP协议配置
       router eigrp xxx
       network xxx.xxx.xxx.xxx
  • OSPF协议配置
       router ospf xxx
       network xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx area 0
  1. 保存配置
    • 保存当前配置到启动配置:
     write memory
 或者
     copy running-config startup-config 
  1. 常用命令
    • 查看当前的路由表:show ip route
    • 查看所有接口的IP和状态:show ip interface brief
    • 调试IP报文(注意使用时可能影响性能):debug ip packet
    • 清除当前的路由表:clear ip route *
    • 查看接口状态和流量统计:
     show interfaces
  1. 故障排查
    • 测试网络连通性:ping
    • 追踪路由路径:traceroute
    • 远程登录测试:telnet
    • 查看VTP状态和配置:
     show vtp status
     show vtp password
  • 查看设备的CDP邻居:
     show cdp neighbors
     show cdp neighbors detail
  1. 设备监控与性能分析
    • 查看CPU使用情况:show processes cpu
    • 查看内存使用情况:show processes memory
    • 检查正在运行的进程:show processes

四、其他实用命令

  1. 帮助命令

    • ?:查看当前可用的命令。
    • <command> ?:查看某个命令的选项。
  2. 查看当前状态

    • show sessions:查看当前终端会话信息。
    • show users:查看当前在线用户。

http://www.kler.cn/news/362282.html

相关文章:

  • python作业02.
  • uniapp,获取头部高度
  • 使用飞桨AI Studio平台训练数据,并进行图像识别分析得牡丹花测试
  • mysql学习教程,从入门到精通,sql序列使用(45)
  • 【算法系列-栈与队列】匹配消除系列
  • 关于HslCommunication的二次开发
  • 9个用于测试自动化的最佳AI测试工具(2024)
  • NoSQL数据库分类简述
  • DSVPN简介与应用
  • Stable Diffusion Web UI 大白话术语解释 (二)
  • 中小型医院网站:Spring Boot开发技巧
  • 【Jmeter】jmeter指定jdk版本启动
  • 利用grid sample优化BevDet
  • ACM CCS 2024现场直击:引爆通信安全新纪元
  • 通过conda install -c nvidia cuda=“11.3.0“ 安装低版本的cuda,但是却安装了高版本的12.4.0
  • PHP 任务管理:跨行业的科技驱动力量
  • rabbitmq 工作队列模式
  • Cloudera Hue深度解析:安装、配置到高级用法
  • 请求第三方接口有反斜杠和双引号怎么处理,且做格式校验?
  • 九、pico+Unity交互开发——触碰抓取
  • ABAP 静态与动态搜索帮助
  • 太速科技-426-基于XC7Z100+TMS320C6678的图像处理板卡
  • Leetcode 3200. 三角形的最大高度
  • 滑动窗口数据采集
  • [漏洞挖掘与防护] 04.Windows系统安全缺陷之5次Shift漏洞启动计算机机理分析
  • java设计模式--行为型模式