对于交换机模拟器来说,我们需要掌握很多种常见的命令使用,以下是常见的命令,记得点击收藏噢 基本配置情况: R> enable 从用户模式进入特权模式 R# disable 从特权模式退到用户模式 R# logout (或exit) 退出Cisco设备 R# show history 查看先前输入的命令(默认10个) R# terminal history size #_of_commands 改变历史缓存的大小(最大256) R# terminal no editing 禁用编辑特性(移去no参数为启用) R# configure terminal 进入配置模式(退出配置模式 CTRL-Z) R(config)# hostname name 改变路由器的名称 R(config)# banner motd delimiting_character banner_character delimiting_character 设置登录横幅 R(config-line)# exec-timeout minutes_# seconds_# 更改休止超时(默认10分钟) R# show hosts 查看路由器解析表中的静态和动态DNS条目 R> show version 查看路由器综合信息 R# show line 验证线路的配置 R# show processes 查看设备的各个进程的CPU使用率 R# show users 查看登录到这台设备上的所有用户 R# show sessions 查看当前挂起的已经打开的telnet会话 R# term ip netmask-format bit-count|decimal|hexadecimal 改变子网掩码显示方式(在当前登录会话期间有效,在子线路模式下即可保存) R(config)# ip host name_of_host [TCP_port_#] IP_address […] 创建主机静态解析表(可指定多达8个IP地址) R(config)# ip name-server IP_address_of_DNS_server […] 配置通过访问DNS服务器动态解析主机(可指定多达6个DNS服务器) R(config)# no ip domain-lookup 禁用DNS查询 R> ping destination_IP_address_or_host_name 查看与目的主机的连通性 R> traceroute destination_IP_address_or_host_name 查看与目的主机间的路由器 R# [telnet|connect] name_of_the_destination|destination_IP_address 打开telnet会话 R# resume connection_# 恢复一个特定的会话 R# disconnect connection_# 结束一已挂起的telnet会话无须恢复它并随后从中退出 R# clear line line_# 结束某人的会话 R# no debug all (或undebug all) 禁用debug R(config)# service timestamps debug datetime msec 在debug输出中显示时间戳 R# terminal monitor 从VTY或辅助线路端口登录执行,路由器将在屏幕上显示报告消息 R(config-line)# logging synchronous在该线路上报告信息后路由器在新提示符后重新显示未打完的命令 CS 文件操作管理: R# show running-config 查看正在运行(当前)的配置文件 R# show startup-config 查看NVRAM中的配置文件 R# copy running-config|startup-config tftp 将配置备份到TFTP服务器 R# copy tftp startup-config|running-config 从TFTP服务器将配置恢复到路由器 R# copy startup-config running-config 从NVRAM中将配置恢复到RAM中 R# copy running-config startup-config 将RAM中的配置文件保存到NVRAM R# erase startup-config 删除NVRAM中的配置文件 R# copy flash tftp 备份IOS镜像到TFTP服务器 R# show flash 查看闪存中的文件 启动配置: R# setup 运行系统配置会话 R(config)# boot system flash name_of_IOS_file_in_flash 启动时加载闪存中的指定IOS文件 R(config)# boot system tftp IOS_image_name IP_address_of_server 启动时加载TFTP服务器里的IOS文件 R(config)# boot system rom 启动时加载ROM中的迷你IOS文件(启动与这三个命令的顺序有关) R(config)# config-register 0x hexadecimal_value 改变寄存器的值 rommon 5> confreg 0x2142 2600、3600系列启动后按CTRL-BREAK进入ROMMON模式,改变寄存器的值 R> o/r 0x2142 其他系列路由器改变寄存器的值的方法 密码设置: R(config)# line console 0 进入控制台接口配置模式 R(config-line)# password console_password 配置控制台口令 R(config)# line vty 0 4 进入虚拟终端线路配置模式(根据路由器及IOS最少5个直到很多) R(config-line)# login 接上条命令,允许进行Telnet访问 R(config-line)# password telnet_password 接上条命令,配置Telnet口令 R(config)# line aux 0 进入辅助端口配置模式 R(config-line)# password console_password 接上条命令,配置辅助端口口令 R(config)# enable password privileged_password 配置特权EXEC口令(不加密) R(config)# enable secret privileged_password 配置特权EXEC口令(加密) 接口配置: R(config)# interface type [slot_#/] port_# 进入接口子配置模式 R(config-if)# description interface_description 添加接口描述 R(config-if)# no shutdown 启用该接口 R(config)# interface loopback port_# 创建环回接口 R(config-if)# media-type aui|10baset|100baset|mii 指定该接口连接的介质类型 R(config-if)# speed 10|100|auto 指定该接口速率 R(config-if)# [no] half-duplex 指定该接口双工模式 R(config-if)# clock rate rate_in_bits_per_second 指定该DCE串行接口速率 R> show controller serial [slot_#/] port_# 验证该接口是DCE还是DTE,注意空格 R(config-if)# bandwidth rate_in_Kbps 改变该接口的带宽值 R(config-if)# ip address IP_address subnet_mask 配置该接口IP地址 R(config)# ip subnet-zero IOS12.0前默认禁用0子网,此命令为启用 R(config-if)# ip directed-broadcast IOS12.0后默认禁用定向广播,此命令为启用 R# show interfaces [type [slot_#/] port_#] 验证接口配置 R# show ip interfaces [type [slot_#/] port_#] [brief] 验证接口IP配置、 路由 R(config)# ip route destination_network_# [subnet_mask] IP_address_of_next_hop_neighbor|interface_to_exit [administrative_distance] [permanent] 配置IP静态路由 R(config)# ip route 0.0.0.0 0.0.0.0 IP_address_of_next_hop_neighbor|interface_to_exit [administrative_distance] [permanent] 配置默认路由 R(config)# ip classless 使有类协议接受非一致性子网掩码或不连续子网 R(config)# interface type [slot_#/] port_#. subinterface_# [point-to-point|multipoint] 创建子接口 R(config-subif)# encapsulation isl|dotlq VLAN_# 指定子接口中继类型和相关的VLAN R(config)# router name_of_the_IP_routing_protocol 进入路由选择协议的配置模式 R# show ip route 查看IP路由表 CDP : R(config)# [no] cdp run 启用/禁用CDP R(config-if)# [no] cdp enable 基于接口启用/禁用CDP R# show cdp 查看CDP状态 R# show cdp interface 查看基于接口的CDP配置 R# show cdp neighbors [detail] 查看与用户Cisco设备相连的CDP邻居的摘要/详细清单 R# show cdp entry neighbor's_name 查看一个指定邻居的详细信息 R# show cdp traffic 查看CDP通信量的统计信息 IGRP: R(config)# router igrp AS_# 配置IP IGRP R(config-router)# network IP_network_# 通告网络号 R(config-router)# neighbor IP_address_of_neighbor 配置单播更新 R(config-router)# passive-interface type [slot_#/] port_# 允许该接口在IGRP中通告但它不监听或发送IGRP更新 R(config-router)# traffic-share min across-interfaces 使路由器只使用最佳路径但又在路由选择表中放入替代路径 R(config-router)# timers basic update_# invalid_# holddown_# flush_# [sleeptime_#] 调整定时器(默认时,update=90,invalid=270,holddown=280,flush=630) R(config-router)# no metric holddown 关闭压制定时器(默认) R(config-router)# distance administrative_distance_# 调整管理距离(取值范围是1-255,默认为100) R(config-router)# default-metric bandwidth_# delay_# reliability_# load_# MTU_# 调整度量值 R(config-router)# metric weights tos_# K1_# K2_# K3_# K4_# K5_# 调整度量权重值(默认时,K1(带宽)=K3(可靠性)=1,K2(延迟)=K4(负载)=K5(MTU)=0) R(config-router)# variance multiplier_# 启用IGRP非同等成本路径(变化因子值1-128默认为1) R(config-router)# traffic-share balanced 配置负载均衡 R(config-router)# maximum-paths paths_# 配置负载均衡的路径条数(取值范围是1-6) R# debug ip igrp events 提供路由器和邻居间发生的每一步操作信息 R# debug ip igrp transactions 提供有关包含在路由更新中路由的详细信息 EIGRP: R(config)# router eigrp AS_# 配置EIGRP R(config-router)# network IP_network_# 通告网络号 R(config-if)# ip bandwidth-percent eigrp AS_# percent_# 设置pacing(调速)占给定接口带宽的百分数(默认为50%) R(config-router)# distance administrative_distance_# 调整管理距离(取值范围是1-255,默认对于内部路由是90而外部是170) R(config-router)# default-metric bandwidth_# delay_# reliability_# load_# MTU_# 调整度量值 R(config-router)# metric weights tos_# K1_# K2_# K3_# K4_# K5_# 调整度量权重值(默认时,K1(带宽)=K3(可靠性)=1,K2(延迟)=K4(负载)=K5(MTU)=0) R(config-if)# ip hello-interval eigrp AS_# seconds_# 在给定接口上设置Hello间隔(默认对于低速的NBMA网络是60秒,其他是5秒) R(config-if)# ip hold-time eigrp AS_# seconds_# 在给定接口上设置Hello保持定时器(默认是3倍的Hello间隔) R(config-router)# passive-interface type [slot_#/] port_# 允许该接口在EIGRP中通告但它不监听或发送EIGRP更新 R(config-router)# no auto-summary 取消对路由的自动汇总 R(config-if)# ip summary-address eigrp AS_# network_address network_mask 创建不在有类边界上的汇总地址 R(config)# eigrp log-neighbor-changes 记录在某个邻居上发生的变化 R# show ip route eigrp 查看被EIGRP学习到的路由 R# show ip route network_address 查看指定目的地的路由信息 R# show ip eigrp topology 查看EIGRP的拓扑表 R# show ip eigrp interfaces 查看加入到EIGRP路由器所有接口的概述 R# show ip eigrp neighbor [detail] 显示和本路由器已形成邻居关系的所有路由器 R# show ip eigrp traffic 显示每个包类型的发出和接收的数量 R# show ip eigrp events 查看每个EIGRP事件的日志 R# debug ip eigrp 提供路由器和它的邻居之间发生的每一步操作 R# debug eigrp packets 查看在该路由器和它的邻居之间发送的数据包类型 R# debug eigrp neighbors 查看邻居的信息