Cisco命令大全。

合集下载

Cisco命令大全

Cisco命令大全

Cisco命令大全switch配置命令(1)模式转换命令用户模式----特权模式,使用命令"enable"特权模式----全局配置模式,使用命令"config t"全局配置模式----接口模式,使用命令"interface+接口类型+接口号" 全局配置模式----线控模式,使用命令"line+接口类型+接口号" 注:用户模式:查看初始化的信息.特权模式:查看所有信息、调试、保存配置信息全局模式:配置所有信息、针对整个路由器或交换机的所有接口接口模式:针对某一个接口的配置线控模式:对路由器进行控制的接口配置(2)配置命令show running config 显示所有的配置show versin 显示版本号和寄存器值shut down 关闭接口no shutdown 打开接口ip add +ip地址配置IP地址secondary+IP地址为接口配置第二个IP地址show interface+接口类型+接口号查看接口管理性show controllers interface 查看接口是否有DCE电缆show history 查看历史记录show terminal 查看终端记录大小hostname+主机名配置路由器或交换机的标识config memory 修改保存在NVRAM中的启动配置exec timeout 0 0 设置控制台会话超时为0service password-encryptin 手工加密所有密码enable password +密码配置明文密码ena sec +密码配置密文密码line vty 0 4/15 进入telnet接口password +密码配置telnet密码line aux 0 进入AUX接口password +密码配置密码line con 0 进入CON接口password +密码配置密码bandwidth+数字配置带宽no ip address 删除已配置的IP地址show startup config 查看NVRAM中的配置信息copy run-config atartup config 保存信息到NVRAMwrite 保存信息到NVRAMerase startup-config 清除NVRAM中的配置信息show ip interface brief 查看接口的谪要信息banner motd # +信息+ # 配置路由器或交换机的描素信息description+信息配置接口听描素信息vlan database 进入VLAN数据库模式vlan +vlan号+ 名称创建VLANswitchport access vlan +vlan号为VLAN为配接口interface vlan +vlan号进入VLAN接口模式ip add +ip地址为VLAN配置管理IP地址vtp+service/tracsparent/client 配置SW的VTP工作模式vtp +domain+域名配置SW的VTP域名vtp +password +密码配置SW的密码switchport mode trunk 启用中继no vlan +vlan号删除VLANshow spamming-tree vlan +vlan号查看VLA怕生成树议2. 路由器配置命令ip route+非直连网段+子网掩码+下一跳地址配置静态/默认路由show ip route 查看路由表show protocols 显示出所有的被动路由协议和接口上哪些协议被设置show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用的定时器等信息router rip 激活RIP协议network +直连网段发布直连网段interface lookback 0 激活逻辑接口passive-interface +接口类型+接口号配置接口为被动模式debug ip +协议动态查看路由更新信息undebug all 关闭所有DEBUG信息router eigrp +as号激活EIGRP路由协议network +网段+子网掩码发布直连网段show ip eigrp neighbors 查看邻居表show ip eigrp topology 查看拓扑表show ip eigrp traffic 查看发送包数量router ospf +process-ID 激活OSPF协议network+直连网段+area+区域号发布直连网段show ip ospf 显示OSPF的进程号和ROUTER-IDencapsulation+封装格式更改封装格式no ip admain-lookup 关闭路由器的域名查找ip routing 在三层交换机上启用路由功能show user 查看SW的在线用户clear line +线路号清除线路3. 三层交换机配置命令配置一组二层端口configure terminal 进入配置状态nterface range {port-range} 进入组配置状态配置三层端口configure terminal 进入配置状态interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} | {port-channel port-channel-number} 进入端口配置状态no switchport 把物理端口变成三层口ip address ip_address subnet_mask 配置IP地址和掩码no shutdown 激活端口例:Switch(config)# interface gigabitethernet0/2Switch(config-if)# no switchportSwitch(config-if)# ip address 192.20.135.21 255.255.255.0Switch(config-if)# no shutdown配置VLANconfigure terminal 进入配置状态vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改。

CISCO命令全集

CISCO命令全集

CISCO命令全集谨以此献给爱好学习的人!Access-enable 允许路由器在动态访问列表中创建临时访问列表入口Access-group 把访问控制列表(ACL)应用到接口上Access-list 定义一个标准的IP ACLAccess-template 在连接的路由器上手动替换临时访问列表入口Appn 向APPN子系统发送命令Atmsig 执行ATM信令命令B 手动引导操作系统Bandwidth 设置接口的带宽Banner motd 指定日期信息标语Bfe 设置突发事件手册模式Boot system 指定路由器启动时加载的系统映像Calendar 设置硬件日历Cd 更改路径Cdp enable 允许接口运行CDP协议Clear 复位功能Clear counters 清除接口计数器Clear interface 重新启动接口上的硬件逻辑Clockrate 设置串口硬件连接的时钟速率,如网络接口模块和接口处理器能接受的速率Cmt 开启/关闭FDDI连接管理功能Config-register 修改配置寄存器设置Configure 允许进入存在的配置模式,在中心站点上维护并保存配置信息Configure memory 从NVRAM加载配置信息Configure terminal 从终端进行手动配置Connect 打开一个终端连接Copy 复制配置或映像数据Copy flash tftp 备份系统映像文件到TFTP服务器Copy running-config startup-config 将RAM中的当前配置存储到NVRAMCopy running-config tftp 将RAM中的当前配置存储到网络TFTP服务器上Copy tftp flash 从TFTP服务器上下载新映像到FlashCopy tftp running-config 从TFTP服务器上下载配置文件Debug 使用调试功能Debug dialer 显示接口在拨什么号及诸如此类的信息Debug ip rip 显示RIP路由选择更新数据Debug ipx routing activity 显示关于路由选择协议(RIP)更新数据包的信息Debug ipx sap 显示关于SAP(业务通告协议)更新数据包信息Debug isdn q921 显示在路由器D通道ISDN接口上发生的数据链路层(第2层)的访问过程Debug ppp 显示在实施PPP中发生的业务和交换信息Delete 删除文件Deny 为一个已命名的IP ACL设置条件Dialer idle-timeout规定线路断开前的空闲时间的长度Dialer map 设置一个串行接口来呼叫一个或多个地点Dialer wait-for-carrier-time 规定花多长时间等待一个载体Dialer-group 通过对属于一个特定拨号组的接口进行配置来访问控制Dialer-list protocol 定义一个数字数据接受器(DDR)拨号表以通过协议或ACL与协议的组合来控制控制拨号Dir 显示给定设备上的文件Disable 关闭特许模式Disconnect 断开已建立的连接Enable 打开特许模式Enable password 确定一个密码以防止对路由器非授权的访问Enable password 设置本地口令控制不同特权级别的访问Enable secret 为enable password命令定义额外一层安全性Encapsulation frame-relay 启动帧中继封装Encapsulation novell-ether 规定在网络段上使用的Novell独一无二的格式Encapsulation PPP 把PPP设置为由串口或ISDN接口使用的封装方法Encapsulation sap 规定在网络段上使用的以太网802.2格式Cisco的密码是sapEnd 退出配置模式Erase 删除闪存或配置缓存Erase startup-config 删除NVRAM中的内容Exec-timeout 配置EXEC命令解释器在检测到用户输入前所等待的时间Exit 退出所有配置模式或者关闭一个激活的终端会话和终止一个EXECExit 终止任何配置模式或关闭一个活动的对话和结束EXECformat 格式化设备Frame-relay local-dlci 为使用帧中继封装的串行线路启动本地管理接口(LMI)Help 获得交互式帮助系统History 查看历史记录Hostname 使用一个主机名来配置路由器,该主机名以提示符或者缺省文件名的方式使用Interface 设置接口类型并且输入接口配置模式Interface 配置接口类型和进入接口配置模式Interface serial 选择接口并且输入接口配置模式Ip access-group 控制对一个接口的访问Ip address 设定接口的网络逻辑地址Ip address 设置一个接口地址和子网掩码并开始IP处理Ip default-network 建立一条缺省路由Ip domain-lookup 允许路由器缺省使用DNSIp host 定义静态主机名到IP地址映射Ip name-server 指定至多6个进行名字-地址解析的服务器地址Ip route 建立一条静态路由Ip unnumbered 在为给一个接口分配一个明确的IP地址情况下,在串口上启动互联网协议(IP)的处理过程Ipx delay 设置点计数Ipx ipxwan 在串口上启动IPXWAN协议Ipx maximum-paths 当转发数据包时设置Cisco IOS软件使用的等价路径数量Ipx network 在一个特定接口上启动互联网数据包交换(IPX)的路由选择并且选择封装的类型(用帧封装)Ipx router 规定使用的路由选择协议Ipx routing 启动IPX路由选择Ipx sap-interval 在较慢的链路上设置较不频繁的SAP(业务广告协议)更新Ipx type-20-input-checks 限制对IPX20类数据包广播的传播的接受Isdn spid1 在路由器上规定已经由ISDN业务供应商为B1信道分配的业务简介号(SPID)Isdn spid2 在路由器上规定已经由ISDN业务供应商为B2信道分配的业务简介号(SPID)Isdn switch-type 规定了在ISDN接口上的中央办公区的交换机的类型Keeplive 为使用帧中继封装的串行线路LMI(本地管理接口)机制Lat 打开LAT连接Line 确定一个特定的线路和开始线路配置Line concole 设置控制台端口线路Line vty 为远程控制台访问规定了一个虚拟终端Lock 锁住终端控制台Login 在终端会话登录过程中启动了密码检查Login 以某用户身份登录,登录时允许口令验证Logout 退出EXEC模式Mbranch 向下跟踪组播地址路由至终端Media-type 定义介质类型Metric holddown 把新的IGRP路由选择信息与正在使用的IGRP路由选择信息隔离一段时间Mrbranch 向上解析组播地址路由至枝端Mrinfo 从组播路由器上获取邻居和版本信息Mstat 对组播地址多次路由跟踪后显示统计数字Mtrace 由源向目标跟踪解析组播地址路径Name-connection 命名已存在的网络连接Ncia 开启/关闭NCIA服务器Network 把一个基于NIC的地址分配给一个与它直接相连的路由器把网络与一个IGRP的路由选择的过程联系起来在IPX路由器配置模式下,在网络上启动加强的IGRPNetwork 指定一个和路由器直接相连的网络地址段Network-number 对一个直接连接的网络进行规定No shutdown 打开一个关闭的接口Pad 开启一个X.29 PAD连接Permit 为一个已命名的IP ACL设置条件Ping 把ICMP响应请求的数据包发送网络上的另一个节点检查主机的可达性和网络的连通性对网络的基本连通性进行诊断Ping 发送回声请求,诊断基本的网络连通性Ppp 开始IETF点到点协议Ppp authentication 启动Challenge握手鉴权协议(CHAP)或者密码验证协议(PAP)或者将两者都启动,并且对在接口上选择的CHAP和PAP验证的顺序进行规定Ppp chap hostname 当用CHAP进行身份验证时,创建一批好像是同一台主机的拨号路由器Ppp chap password 设置一个密码,该密码被发送到对路由器进行身份验证的主机命令对进入路由器的用户名/密码的数量进行了限制Ppp pap sent-username 对一个接口启动远程PAP支持,并且在PAP对同等层请求数据包验证过程中使用sent-username和passwordProtocol 对一个IP路由选择协议进行定义,该协议可以是RIP,内部网关路由选择协议(IGRP),开放最短路径优先(OSPF),还可以是加强的IGRPPwd 显示当前设备名Reload 关闭并执行冷启动;重启操作系统Rlogin 打开一个活动的网络连接Router 由第一项定义的IP路由协议作为路由进程,例如:router rip 选择RIP作为路由协议Router igrp 启动一个IGRP的路由选择过程Router rip 选择RIP作为路由选择协议Rsh 执行一个远程命令Sdlc 发送SDLC测试帧Send 在tty线路上发送消息Service password-encryption 对口令进行加密Setup 运行Setup命令Show 显示运行系统信息Show access-lists 显示当前所有ACL的内容Show buffers 显示缓存器统计信息Show cdp entry 显示CDP表中所列相邻设备的信息Show cdp interface 显示打开的CDP接口信息Show cdp neighbors 显示CDP查找进程的结果Show dialer 显示为DDR(数字数据接受器)设置的串行接口的一般诊断信息Show flash 显示闪存的布局和内容信息Show frame-relay lmi 显示关于本地管理接口(LMI)的统计信息Show frame-relay map 显示关于连接的当前映射入口和信息Show frame-relay pvc 显示关于帧中继接口的永久虚电路(pvc)的统计信息Show hosts 显示主机名和地址的缓存列表Show interfaces 显示设置在路由器和访问服务器上所有接口的统计信息Show interfaces 显示路由器上配置的所有接口的状态Show interfaces serial 显示关于一个串口的信息Show ip interface 列出一个接口的IP信息和状态的小结Show ip interface 列出接口的状态和全局参数Show ip protocols 显示活动路由协议进程的参数和当前状态Show ip route 显示路由选择表的当前状态Show ip router 显示IP路由表信息Show ipx interface 显示Cisco IOS软件设置的IPX接口的状态以及每个接口中的参数Show ipx route 显示IPX路由选择表的内容Show ipx servers 显示IPX服务器列表Show ipx traffic 显示数据包的数量和类型Show isdn active 显示当前呼叫的信息,包括被叫号码、建立连接前所花费的时间、在呼叫期间使用的自动化操作控制(AOC)收费单元以及是否在呼叫期间和呼叫结束时提供AOC信息Show isdn ststus 显示所有isdn接口的状态、或者一个特定的数字信号链路(DSL)的状态或者一个特定isdn接口的状态Show memory 显示路由器内存的大小,包括空闲内存的大小Show processes 显示路由器的进程Show protocols 显示设置的协议Show protocols 显示配置的协议。

CISCO命令大全

CISCO命令大全

1.在基于IOS的交换机上设置主机名/系统名:switch(config)# hostname hostname在基于CLI的交换机上设置主机名/系统名:switch(enable) set system name name-string2.在基于IOS的交换机上设置登录口令:switch(config)# enable password level 1 password在基于CLI的交换机上设置登录口令:switch(enable) set passwordswitch(enable) set enalbepass3.在基于IOS的交换机上设置远程访问:switch(config)# interface vlan 1switch(config-if)# ip address ip-address netmaskswitch(config-if)# ip default-gateway ip-address在基于CLI的交换机上设置远程访问:switch(enable) set interface sc0 ip-address netmask broadcast-address switch(enable) set interface sc0 vlanswitch(enable) set ip route default gateway4.在基于IOS的交换机上启用和浏览CDP信息:switch(config-if)# cdp enableswitch(config-if)# no cdp enable为了查看Cisco邻接设备的CDP通告信息:switch# show cdp interface [type modle/port]switch# show cdp neighbors [type module/port] [detail]在基于CLI的交换机上启用和浏览CDP信息:switch(enable) set cdp {enable|disable} module/port为了查看Cisco邻接设备的CDP通告信息:switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail]5.基于IOS的交换机的端口描述:switch(config-if)# description description-string基于CLI的交换机的端口描述:switch(enable)set port name module/number description-string6.在基于IOS的交换机上设置端口速度:switch(config-if)# speed{10|100|auto}在基于CLI的交换机上设置端口速度:switch(enable) set port speed moudle/number {10|100|auto}switch(enable) set port speed moudle/number {4|16|auto}7.在基于IOS的交换机上设置以太网的链路模式:switch(config-if)# duplex {auto|full|half}在基于CLI的交换机上设置以太网的链路模式:switch(enable) set port duplex module/number {full|half}8.在基于IOS的交换机上配置静态VLAN:switch# vlan databaseswitch(vlan)# vlan vlan-num name vlaswitch(vlan)# exitswitch# configure teriminalswitch(config)# interface interface module/numberswitch(config-if)# switchport mode accessswitch(config-if)# switchport access vlan vlan-numswitch(config-if)# end在基于CLI的交换机上配置静态VLAN:switch(enable) set vlan vlan-num [name name]switch(enable) set vlan vlan-num mod-num/port-list9. 在基于IOS的交换机上配置VLAN中继线:switch(config)# interface interface mod/portswitch(config-if)# switchport mode trunkswitch(config-if)# switchport trunk encapsulation {isl|dotlq}switch(config-if)# switchport trunk allowed vlan remove vlan-list switch(config-if)# switchport trunk allowed vlan add vlan-list在基于CLI的交换机上配置VLAN中继线:switch(enable) set trunk module/port [on|off|desirable|auto|nonegotiate] Vlan-range [isl|dotlq|dotl0|lane|negotiate]10.在基于IOS的交换机上配置VTP管理域:switch# vlan databaseswitch(vlan)# vtp domain domain-name在基于CLI的交换机上配置VTP管理域:switch(enable) set vtp [domain domain-name]11.在基于IOS的交换机上配置VTP 模式:switch# vlan databaseswitch(vlan)# vtp domain domain-nameswitch(vlan)# vtp {sever|cilent|transparent}switch(vlan)# vtp password password在基于CLI的交换机上配置VTP 模式:switch(enable) set vtp [domain domain-name] [mode{ sever|cilent|transparent }][password password]12. 在基于IOS的交换机上配置VTP版本:switch# vlan databaseswitch(vlan)# vtp v2-mode在基于CLI的交换机上配置VTP版本:switch(enable) set vtp v2 enable13. 在基于IOS的交换机上启动VTP剪裁:switch# vlan databaseswitch(vlan)# vtp pruning在基于CL I 的交换机上启动VTP剪裁:switch(enable) set vtp pruning enable14.在基于IOS的交换机上配置以太信道:switch(config-if)# port group group-number [distribution {source|destination}]在基于CLI的交换机上配置以太信道:switch(enable) set port channel moudle/port-range mode{on|off|desirable|auto}15.在基于IOS的交换机上调整根路径成本:switch(config-if)# spanning-tree [vlan vlan-list] cost cost在基于CLI的交换机上调整根路径成本:switch(enable) set spantree portcost moudle/port costswitch(enable) set spantree portvlancost moudle/port [cost cost][vlan-list] 16.在基于IOS的交换机上调整端口ID:switch(config-if)# spanning-tree[vlan vlan-list]port-priority port-priority 在基于CLI的交换机上调整端口ID:switch(enable) set spantree portpri {mldule/port}priorityswitch(enable) set spantree portvlanpri {module/port}priority [vlans] 17. 在基于IOS的交换机上修改STP时钟:switch(config)# spanning-tree [vlan vlan-list] hello-time secondsswitch(config)# spanning-tree [vlan vlan-list] forward-time seconds` switch(config)# spanning-tree [vlan vlan-list] max-age seconds在基于CLI的交换机上修改STP时钟:switch(enable) set spantree hello interval[vlan]switch(enable) set spantree fwddelay delay [vlan]switch(enable) set spantree maxage agingtiame[vlan]18. 在基于IOS的交换机端口上启用或禁用Port Fast 特征:switch(config-if)#spanning-tree portfast在基于CLI的交换机端口上启用或禁用Port Fast 特征:switch(enable) set spantree portfast {module/port}{enable|disable}19. 在基于IOS的交换机端口上启用或禁用UplinkFast 特征: switch(config)# spanning-tree uplinkfast [max-update-rate pkts-per-second]在基于CLI的交换机端口上启用或禁用UplinkFast 特征:switch(enable) set spantree uplinkfast {enable|disable}[rate update-rate] [all-protocols off|on]20. 为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个IP地址,然后使用下列命令: switch(config)# cluster enable cluster-name21. 为了从一条中继链路上删除VLAN,可使用下列命令:switch(enable) clear trunk module/port vlan-range22. 用show vtp domain 显示管理域的VTP参数.23. 用show vtp statistics显示管理域的VTP参数.24. 在Catalyst交换机上定义TrBRF的命令如下:switch(enable) set vlan vlan-name [name name] type trbrf bridge bridge-num[stp {ieee|ibm}]25. 在Catalyst交换机上定义TrCRF的命令如下:switch (enable) set vlan vlan-num [name name] type trcrf{ring hex-ring-num|decring decimal-ring-num} parent vlan-num26. 在创建好TrBRF VLAN之后,就可以给它分配交换机端口.对于以太网交换,可以采用如下命令给VLAN分配端口:switch(enable) set vlan vlan-num mod-num/port-num27. 命令show spantree显示一个交换机端口的STP状态.28. 配置一个ELAN的LES和BUS,可以使用下列命令:ATM (config)# interface atm number.subint multiointATM(config-subif)# lane serber-bus ethernet elan-name29. 配置LECS:ATM(config)# lane database database-nameATM(lane-config-databade)# name elan1-name server-atm-address les1-nsap-addressATM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-addressATM(lane-config-databade)# name …30. 创建完数据库后,必须在主接口上启动LECS.命令如下:ATM(config)# interface atm numberATM(config-if)# lane config database database-nameATM(config-if)# lane config auto-config-atm-address31. 将每个LEC配置到一个不同的ATM子接口上.命令如下:ATM(config)# interface atm number.subint multipointATM(config)# lane client ethernet vlan-num elan-num32. 用show lane server 显示LES的状态.33. 用show lane bus显示bus的状态.34. 用show lane database显示LECS数据库可内容.35. 用show lane client显示LEC的状态.36. 用show module显示已安装的模块列表.37. 用物理接口建立与VLAN的连接:router# configure terminalrouter(config)# interface media module/portrouter(config-if)# description description-stringrouter(config-if)# ip address ip-addr subnet-maskrouter(config-if)# no shutdown38. 用中继链路来建立与VLAN的连接:router(config)# interface module/port.subinterfacerouter(config-ig)# encapsulation[isl|dotlq] vlan-numberrouter(config-if)# ip address ip-address subnet-mask39. 用LANE 来建立与VLAN的连接:router(config)# interface atm module/portrouter(config-if)# no ip addressrouter(config-if)# atm pvc 1 0 5 qsaalrouter(config-if)# atm pvc 2 0 16 ilnirouter(config-if)# interface atm module/port.subinterface multipoint router(config-if)# ip address ip-address subnet-maskrouter(config-if)# lane client ethernet elan-numrouter(config-if)# interface atm module/port.subinterface multipoint router(config-if)# ip address ip-address subnet-namerouter(config-if)# lane client ethernet elan-namerouter(config-if)# …40. 为了在路由处理器上进行动态路由配置,可以用下列IOS命令来进行:router(config)# ip routingrouter(config)# router ip-routing-protocolrouter(config-router)# network ip-network-numberrouter(config-router)# network ip-network-number41. 配置默认路由:switch(enable) set ip route default gateway42. 为一个路由处理器分配VLANID,可在接口模式下使用下列命令: router(config)# interface interface numberrouter(config-if)# mls rp vlan-id vlan-id-num43. 在路由处理器启用MLSP:router(config)# mls rp ip44. 为了把一个外置的路由处理器接口和交换机安置在同一个VTP 域中:router(config)# interface interface numberrouter(config-if)# mls rp vtp-domain domain-name45. 查看指定的VTP域的信息:router# show mls rp vtp-domain vtp domain name46. 要确定RSM或路由器上的管理接口,可以在接口模式下输入下列命令:router(config-if)#mls rp management-interface47. 要检验MLS-RP的配置情况:router# show mls rp48. 检验特定接口上的MLS配置:router# show mls rp interface interface number49. 为了在MLS-SE上设置流掩码而又不想在任一个路由处理器接口上设置访问列表:set mls flow [destination|destination-source|full]50. 为使MLS和输入访问列表可以兼容,可以在全局模式下使用下列命令:router(config)# mls rp ip input-acl51. 当某个交换机的第3层交换失效时,可在交换机的特权模式下输入下列命令:switch(enable) set mls enable52. 若想改变老化时间的值,可在特权模式下输入以下命令:switch(enable) set mls agingtime agingtime53. 设置快速老化:switch(enable) set mls agingtime fast fastagingtime pkt_threshold54. 确定那些MLS-RP和MLS-SE参与了MLS,可先显示交换机引用列表中的内容再确定:switch(enable) show mls include55. 显示MLS高速缓存记录:switch(enable) show mls entry56. 用命令show in arp显示ARP高速缓存区的内容。

cisco命令大全及一些实验

cisco命令大全及一些实验

cisco命令大全1. switch配置命令(1)模式转换命令用户模式----特权模式,使用命令"enable"特权模式----全局配置模式,使用命令"config t"全局配置模式----接口模式,使用命令"interface+接口类型+接口号" 全局配置模式----线控模式,使用命令"line+接口类型+接口号" 注:用户模式:查看初始化的信息.特权模式:查看所有信息、调试、保存配置信息全局模式:配置所有信息、针对整个路由器或交换机的所有接口接口模式:针对某一个接口的配置线控模式:对路由器进行控制的接口配置(2)配置命令show running config 显示所有的配置show versin 显示版本号和寄存器值shut down 关闭接口no shutdown 打开接口ip add +ip地址配置IP地址secondary+IP地址为接口配置第二个IP地址show interface+接口类型+接口号查看接口管理性show controllers interface 查看接口是否有DCE电缆show history 查看历史记录show terminal 查看终端记录大小hostname+主机名配置路由器或交换机的标识config memory 修改保存在NVRAM中的启动配置exec timeout 0 0 设置控制台会话超时为0service password-encryptin 手工加密所有密码enable password +密码配置明文密码enable sec +密码配置密文密码line vty 0 4/15 进入telnet接口password +密码配置telnet密码line aux 0 进入AUX接口password +密码配置密码line con 0 进入CON接口password +密码配置密码bandwidth+数字配置带宽no ip address 删除已配置的IP地址show startup config 查看NVRAM中的配置信息copy run-config startup config 保存信息到NVRAMwrite 保存信息到NVRAMerase startup-config 清除NVRAM中的配置信息show ip interface brief 查看接口的谪要信息banner motd # +信息+ # 配置路由器或交换机的描素信息description+信息配置接口听描素信息vlan database 进入VLAN数据库模式vlan +vlan号+ 名称创建VLANswitchport access vlan +vlan号为VLAN为配接口interface vlan +vlan号进入VLAN接口模式ip add +ip地址为VLAN配置管理IP地址vtp+service/tracsparent/client 配置SW的VTP工作模式vtp +domain+域名配置SW的VTP域名vtp +password +密码配置SW的密码switchport mode trunk 启用中继no vlan +vlan号删除VLANshow spanniing-tree vlan +vlan号查看VLA怕生成树议show interfaces | exclde/include "bia" (查看:不包括/只包括有关BIA的数据)2. 路由器配置命令ip route+非直连网段+子网掩码+下一跳地址配置静态/默认路由show ip route 查看路由表show protocols 显示出所有的被动路由协议和接口上哪些协议被设置show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用的定时器等信息router rip 激活RIP协议network +直连网段发布直连网段interface loopback 0 激活逻辑接口passive-interface +接口类型+接口号配置接口为被动模式debug ip +协议动态查看路由更新信息undebug all 关闭所有DEBUG信息router eigrp +as号激活EIGRP路由协议network +网段+子网掩码发布直连网段show ip eigrp neighbors 查看邻居表show ip eigrp topology 查看拓扑表show ip eigrp traffic 查看发送包数量router ospf +process-ID 激活OSPF协议network+直连网段+area+区域号发布直连网段show ip ospf 显示OSPF的进程号和ROUTER-IDencapsulation+封装格式更改封装格式no ip admain-lookup 关闭路由器的域名查找ip routing 在三层交换机上启用路由功能show user 查看SW的在线用户clear line +线路号清除线路3. 三层交换机配置命令配置一组二层端口interface range {port-range} 进入组配置状态配置三层端口configure terminal 进入配置状态interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} | {port-channel port-channel-number} 进入端口配置状态no switchport 把物理端口变成三层口ip address ip_address subnet_mask 配置IP地址和掩码no shutdown 激活端口例:Switch(config)# interface gigabitethernet0/2Switch(config-if)# no switchportSwitch(config-if)# ip address 192.20.135.21 255.255.255.0Switch(config-if)# no shutdown配置VLANconfigure terminal 进入配置状态vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改。

CISCO命令大全

CISCO命令大全

CISCO路由命令大全Cisco 路由器常用命令1 Exec commands:<1-99> 恢复一个会话bfe 手工应急模式设置clear 复位功能clock 管理系统时钟configure 进入设置模式connect 打开一个终端copy 从tftp服务器拷贝设置文件或把设置文件拷贝到tftp服务器上debug 调试功能disable 退出优先命令状态disconnect 断开一个网络连接enable 进入优先命令状态erase 擦除快闪内存exit 退出exce模式help 交互帮助系统的描述lat 打开一个本地传输连接lock 锁定终端login 以一个用户名登录logout 退出终端mbranch 向树形下端分支跟踪多路由广播mrbranch 向树形上端分支跟踪反向多路由广播name-connection 给一个存在的网络连接命名no 关闭调试功能pad 打开X.29 PAD连接ping 发送回显信息ppp 开始点到点的连接协议reload 停机并执行冷启动resume 恢复一个活动的网络连接rlogin 打开远程注册连接rsh 执行一个远端命令send 发送信息到另外的终端行setup 运行setup命令show 显示正在运行系统信息slip 开始SLIP协议start-chat 在命令行上执行对话描述systat 显示终端行的信息telnet 远程登录terminal 终端行参数test 测试子系统内存和端口tn3270 打开一个tin3270连接trace 跟踪路由到目的地undebug 退出调试功能verify 验证检查闪烁文件的总数where 显示活动的连接which-route 执行OSI路由表查找并显示结果write 把正在运行的设置写入内存、网络、或终端x3 在PAD上设置X.3参数xremote 进入xremote模式2 #show ?access-expression 显示访问控制表达式access-lists 显示访问控制表apollo Apollo 网络信息appletalk Apple Talk 信息arap 显示Appletalk 远端通道统计arp 地址解析协议表async 访问路由接口的终端行上的信息bridge 前向网络数据库buffers 缓冲池统计clns CLNS网络信息clock 显示系统时钟cmns 连接模式网络服务信息compress 显示压缩状态configuration 非易失性内存的内容controllers 端口控制状态debugging 调试选项状态decnet DEC网络信息dialer 拨号参数和统计dnsix 显示Dnsix/DMPP信息entry 排队终端入口extended 扩展端口信息flash 系统闪烁信息flh-log 闪烁装载帮助日志缓冲区frame-relay 帧中继信息history 显示对话层历史命令hosts IP域名,查找方式,名字服务,主机表interfaces 端口状态和设置ip IP信息ipx Novell IPX信息isis IS-IS路由信息keymap 终端键盘映射lat DEC LAT信息line 终端行信息llc2 IBM LLC2 环路信息lnm IBM 局网管理local-ack 本地认知虚环路memory 内存统计netbios-cache NetBios命名缓冲存贮器内存node 显示已知LAT节点ntp 网络时间协议processes 活动进程统计protocols 活动网络路由协议queue 显示队列内容queueing 显示队列设置registry 功能注册信息rhosts 远程主机文件rif RIF存贮器入口route-map 路由器信息sdlle 显示sdlc-llc2转换信息services 已知LAT服务sessions 远程连接信息smds SMDS信息source-bridge 源网桥参数和统计spanning-tree 跨越树形拓朴stacks 进程堆栈应用standby 热支持协议信息stun STUN状态和设置subsystem 显示子系统tcp TCP连接状态terminal 显示终端设置tn3270 TN3270 设置translate 协议转换信息ttycap 终端容易表users 显示终端行的信息version 系统硬、软件状态vines VINES信息whoami 当前终端行信息x25 X.25信息xns XNS信息xermote Xremote统计3 #config ?Memory 从非易失性内存设置Network 从TFTP网络主机设置Overwrite-network 从TFTP网络主机设置覆盖非易失性内存Terminal 从终端设置4 Configure commads:Access-list 增加一个访问控制域Apollo Apollo全局设置命令appletalk Appletalk 全局设置命令arap Appletalk远程进出协议arp 设置一个静态ARP入口async-bootp 修改系统启动参数autonomous-system 本地所拥有的特殊自治系统成员banner 定义注册显示信息boot 修改系统启动时参数bridge 透明网桥buffers 调整系统缓冲池参数busy-message 定义当连接主机失败时显示信息chat-s cript 定义一个调制解调器对话文本clns 全局CLNS设置子命令clock 设置时间时钟config-register 定义设置寄存器decnet 全局DEC网络设置子命令default-value 缺省字符位值dialer-list 创建一个拨号清单入口dnsix-nat 为审计提供DMDM服务enable 修改优先命令口令end 从设置模式退出exit 从设置模式退出frame-relay 全局帧中继设置命令help 交互帮助系统的描述hostname 设置系统网络名iterface 选择设置的端口ip 全局地址设置子命令ipx Novell/IPX全局设置命令keymap 定义一个新的键盘映射lat DEC本地传输协议line 设置终端行lnm IBM局网管理locaddr-priority-list 在LU地址上建立优先队列logging 修改注册(设备)信息login-string 定义主机指定的注册字符串map-class 设置静态表类map-list 设置静态表清单menu 定义用户接口菜单mop 设置DEC MOP服务器netbios NETBIOS通道控制过滤no 否定一个命令或改为缺省设置ntp 设置NTPpriority-list 建立特权列表prompt 设置系统提示符queue-list 建立常规队列列表rcmd 远程命令设置命令rcp-enable 打开Rep服务rif 源路由进程router-map 建立路由表或进入路由表命令模式router 打开一个路由进程rsh-enable 打开一个RSH服务sap-priority-list 在SAP或MAC地址上建立一个优先队列service 修改网络基本服务snmp-server 修改SNMP参数state-machine 定义一个TCP分配状态的机器stun STUN全局设置命令tacacs-server 修改TACACS队列参数terminal-queue 终端队列命令tftp-server 为网络装载请求提供TFTP服务tn3270 tn3270设置命令translate 解释全局设置命令username 建立一个用户名及其权限vines VINES全局设置命令x25 X.25 的第三级x29 X.29 命令xns XNS 全局设置命令xremote 设置Xremote5 (config)#ipGlobal IP configuration subcommands: Accounting-list 选择保存IP记帐信息的主机Accounting-threshold 设置记帐入口的最大数accounting-transits 设置通过入口的最大数alias TCP端口的IP地址取别名as-path BGP自治系统路径过滤cache-invalidate-delay 延迟IP路由存贮池的无效classless 跟随无类前向路由规则default-network 标志网络作为缺省网关候选default-gateway 指定缺省网(如果没有路由IP)domain-list 完成无资格主机的域名domain-lookup 打开IP域名服务系统主机转换domain-name 定义缺省域名forward-protocol 控制前向的、物理的、直接的IP广播host 为IP主机表增加一个入口host-routing 打开基于主机的路由(代理ARP和再定向)hp-host 打开HP代理探测服务mobile-host 移动主机数据库multicast-routing 打开前向IPname-server 指定所用名字服务器的地址ospf-name-lookup 把OSPF路由作为DNS名显示pim PIM 全局命令route 建立静态路由routing 打开IP路由security 指定系统安全信息source-route 根据源路由头的选择处理包subnet-zero 允许子网0子网tcp 全局TCP参数路由器在计算机网络中有着举足轻重的地位,是计算机网络的桥梁。

Cisco常用命令及缩写

Cisco常用命令及缩写

Cisco常用命令及缩写Cisco常用命令及缩写1、↑/↓键:调出上/下一条命令。

Tab键:补全命令。

?键:调出当前模式下的所有命令。

2、注销本次登录:exit、logout、quit。

3、no:取消某配置例如“no ip add 192.168.1.2 255.255.255.0”,或命令的反义例如“no shutdown”。

Switch (vlan)# no vlan 2 \\删除编号为2的VLAN<前提该VLAN不包含任何端口> Switch(config-if)# no switchport access vlan 2 Router(config-router)# no router rip \\取消RIP配置的动态路由信息4、缩写enable →en configure terminal →conf t show →sh interface →int fastethernet 0/1 →f0/1 ethernet 0/1 →e0/1 serial 2/0 →s2/0 address →add password →pass shutdown →shut console →con hostname →host database →data encapsulation →enca第一章计算机网络结构概述1. > enable # config terminal Router (config)# interface fastethernet0/1 Switch (config)# interface vlan 1 用户模式→特权模式特权模式→全局配置模式(路由器)全局配置模式→接口模式(交换机)全局配置模式→接口模式2. # disable 特权模式→用户模式3. (config)# end 全局或接口模式→特权模式,等同于“ctrl+z”4. exit 从当前模式退回到前一模式5. (config)#interface vlan 1 进入vlan 1接口6. (config-if)# ip address 192.168.1.2 255.255.255.0 配置当前接口的IP地址(注意给交换机只能配置vlan1 的IP,而对路由器可以对物理端口配置IP)7. (config-if)# no shutdown 打开当前接口8. (config)# hostname R1 配置主机名,例如为R1(接口模式下也可用该命令)9. # show version 显示系统IOS名称及版本信息10. # show running-config 显示当前配置信息11. # show startup-config 显示已保存的配置信息12. # copy running-config startup-config 保存当前已配置的信息(2种命令均可)13. # write14. # erase nvram 删除已保存的配置信息(3种命令均可)15. # delete nvram: startup-config16. # erase startup-config17. (config)# line console 0 (config-line)# exec-timeout 0 0 修改会话超时时间,避免返回到初始界面(此时需按下Enter键才进入用户界面)。

CISCO命令大全

CISCO命令大全

CISCO路由命令大全Access-list 定义一个标准的IP ACLAccess-template 在连接的路由器上手动替换临时访问列表入口Appn 向APPN子系统发送命令Atmsig 执行ATM信令命令B 手动引导操作系统Bandwidth 设置接口的带宽Banner motd 指定日期信息标语Bfe 设置突发事件手册模式Boot system 指定路由器启动时加载的系统映像Calendar 设置硬件日历Cd 更改路径Cdp enable 允许接口运行CDP协议Clear 复位功能Clear counters 清除接口计数器Clear interface 重新启动接口上的件逻辑Clockrate 设置串口硬件连接的时钟速率,如网络接口模块和接口处理器能接受的速率Cmt 开启/关闭FDDI连接管理功能Config-register 修改配置寄存器设置Configure 允许进入存在的配置模式,在中心站点上维护并保存配置信息Configure memory 从NVRAM加载配置信息Configure terminal 从终端进行手动配置Connect 打开一个终端连接Copy 复制配置或映像数据Copy flash tftp 备份系统映像文件到TFTP服务器Copy running-config startup-config 将RAM中的当前配置存储到NVRAMCopy running-config tftp 将RAM中的当前配置存储到网络TFTP服务器上Copy tftp flash 从TFTP服务器上下载新映像到FlashCopy tftp running-config 从TFTP服务器上下载配置文件Debug 使用调试功能Debug dialer 显示接口在拨什么号及诸如此类的信息Debug ip rip 显示RIP路由选择更新数据Debug ipx routing activity 显示关于路由选择协议(RIP)更新数据包的信息Debug ipx sap 显示关于SAP(业务通告协议)更新数据包信息Debug isdn q921 显示在路由器D通道ISDN接口上发生的数据链路层(第2层)的访问过程Debug ppp 显示在实施PPP中发生的业务和交换信息Delete 删除文件Deny 为一个已命名的IP ACL设置条件Dialer idle-timeout 规定线路断开前的空闲时间的长度Dialer map 设置一个串行接口来呼叫一个或多个地点Dialer wait-for-carrier-time 规定花多长时间等待一个载体Dialer-group 通过对属于一个特定拨号组的接口进行配置来访问控制Dialer-list protocol 定义一个数字数据接受器(DDR)拨号表以通过协议或ACL与协议的组合来控制控制拨号Dir 显示给定设备上的文件Disable 关闭特许模式Disconnect 断开已建立的连接Enable 打开特许模式Enable password 确定一个密码以防止对路由器非授权的访问Enable password 设置本地口令控制不同特权级别的访问Enable secret 为enable password命令定义额外一层安全性(强制安全,密码非明文显示) Encapsulation frame-relay 启动帧中继封装Encapsulation novell-ether 规定在网络段上使用的Novell独一无二的格式Encapsulation PPP 把PPP设置为由串口或ISDN接口使用的封装方法Encapsulation sap 规定在网络段上使用的以太网802.2格式Cisco的密码是sapEnd 退出配置模式Erase 删除闪存或配置缓存Erase startup-config 删除NVRAM中的内容Exec-timeout 配置EXEC命令解释器在检测到用户输入前所等待的时间Exit 退出所有配置模式或者关闭一个激活的终端会话和终止一个EXECExit 终止任何配置模式或关闭一个活动的对话和结束EXECformat 格式化设备Frame-relay local-dlci 为使用帧中继封装的串行线路启动本地管理接口(LMI)Help 获得交互式帮助系统History 查看历史记录Hostname 使用一个主机名来配置路由器,该主机名以提示符或者缺省文件名的方式使用Interface 设置接口类型并且输入接口配置模式Interface 配置接口类型和进入接口配置模式Interface serial 选择接口并且输入接口配置模式Ip access-group 控制对一个接口的访问Ip address 设定接口的网络逻辑地址Ip address 设置一个接口地址和子网掩码并开始IP处理Ip default-network 建立一条缺省路由Ip domain-lookup 允许路由器缺省使用DNSIp host 定义静态主机名到IP地址映射Ip name-server 指定至多6个进行名字-地址解析的服务器地址Ip route 建立一条静态路由Ip unnumbered 在为给一个接口分配一个明确的IP地址情况下,在串口上启动互联网协议(IP)的处理过程Ipx delay 设置点计数Ipx ipxwan 在串口上启动IPXWAN协议Ipx maximum-paths 当转发数据包时设置Cisco IOS软件使用的等价路径数量Ipx network 在一个特定接口上启动互联网数据包交换(IPX)的路由选择并且选择封装的类型(用帧封装)Ipx router 规定使用的路由选择协议Ipx routing 启动IPX路由选择Ipx sap-interval 在较慢的链路上设置较不频繁的SAP(业务广告协议)更新Ipx type-20-input-checks 限制对IPX20类数据包广播的传播的接受Isdn spid1 在路由器上规定已经由ISDN业务供应商为B1信道分配的业务简介号(SPID)Isdn spid2 在路由器上规定已经由ISDN业务供应商为B2信道分配的业务简介号(SPID)Isdntch-type 规定了在ISDN接口上的中央办公区的交换机的类型Keeplive 为使用帧中继封装的串行线路LMI(本地管理接口)机制Lat 打开LAT连接Line 确定一个特定的线路和开始线路配置Line concole 设置控制台端口线路Line vty 为远程控制台访问规定了一个虚拟终端Lock 锁住终端控制台Login 在终端会话登录过程中启动了密码检查Login 以某用户身份登录,登录时允许口令验证Logout 退出EXEC模式Mbranch 向下跟踪组播地址路由至终端Media-type 定义介质类型Metric holddown 把新的IGRP路由选择信息与正在使用的IGRP路由选择信息隔离一段时间Mrbranch 向上解析组播地址路由至枝端Mrinfo 从组播路由器上获取邻居和版本信息Mstat 对组播地址多次路由跟踪后显示统计数字Mtrace 由源向目标跟踪解析组播地址路径Name-connection 命名已存在的网络连接Ncia 开启/关闭NCIA服务器Network 把一个基于NIC的地址分配给一个与它直接相连的路由器把网络与一个IGRP的路由选择的过程联系起来在IPX路由器配置模式下,在网络上启动加强的IGRPNetwork 指定一个和路由器直接相连的网络地址段Network-number 对一个直接连接的网络进行规定No shutdown 打开一个关闭的接口Pad 开启一个X.29 PAD连接Permit 为一个已命名的IP ACL设置条件Ping 把ICMP响应请求的数据包发送网络上的另一个节点检查主机的可达性和网络的连通性对网络的基本连通性进行诊断Ping 发送回声请求,诊断基本的网络连通性Ppp 开始IETF点到点协议Ppp authentication 启动Challenge握手鉴权协议(CHAP)或者密码验证协议(PAP)或者将两者都启动,并且对在接口上选择的CHAP和PAP验证的顺序进行规定Ppp chap hostname 当用CHAP进行身份验证时,创建一批好像是同一台主机的拨号路由器Ppp chap password 设置一个密码,该密码被发送到对路由器进行身份验证的主机命令对进入路由器的用户名/密码的数量进行了限制Ppp pap sent-username 对一个接口启动远程PAP支持,并且在PAP对同等层请求数据包验证过程中使用sent-username和passwordProtocol 对一个IP路由选择协议进行定义,该协议可以是RIP,内部网关路由选择协议(IGRP),开放最短路径优先(OSPF),还可以是加强的IGRPPwd 显示当前设备名Reload 关闭并执行冷启动;重启操作系统Rlogin 打开一个活动的网络连接Router 由第一项定义的IP路由协议作为路由进程,例如:router rip 选择RIP作为路由协议Router igrp 启动一个IGRP的路由选择过程Router rip 选择RIP作为路由选择协议Rsh 执行一个远程命令Sdlc 发送SDLC测试帧Send 在tty线路上发送消息Service password-encryption 对口令进行加密Setup 运行Setup命令Show 显示运行系统信息Show access-lists 显示当前所有ACL的内容Show buffers 显示缓存器统计信息Show cdp entry 显示CDP表中所列相邻设备的信息Show cdp interface 显示打开的CDP接口信息Show cdp neighbors 显示CDP查找进程的结果Show dialer 显示为DDR(数字数据接受器)设置的串行接口的一般诊断信息Show flash 显示闪存的布局和内容信息Show frame-relay lmi 显示关于本地管理接口(LMI)的统计信息Show frame-relay map 显示关于连接的当前映射入口和信息Show frame-relay pvc 显示关于帧中继接口的永久虚电路(pvc)的统计信息Show hosts 显示主机名和地址的缓存列表Show interfaces 显示设置在路由器和访问服务器上所有接口的统计信息Show interfaces 显示路由器上配置的所有接口的状态Show interfaces serial 显示关于一个串口的信息Show ip interface 列出一个接口的IP信息和状态的小结Show ip interface 列出接口的状态和全局参数Show ip protocols 显示活动路由协议进程的参数和当前状态Show ip route 显示路由选择表的当前状态Show ip router 显示IP路由表信息Show ipx interface 显示Cisco IOS软件设置的IPX接口的状态以及每个接口中的参数Show ipx route 显示IPX路由选择表的内容Show ipx servers 显示IPX服务器列表Show ipx traffic 显示数据包的数量和类型Show isdn active 显示当前呼叫的信息,包括被叫号码、建立连接前所花费的时间、在呼叫期间使用的自动化操作控制(AOC)收费单元以及是否在呼叫期间和呼叫结束时提供AOC信息Show isdn ststus 显示所有isdn接口的状态、或者一个特定的数字信号链路(DSL)的状态或者一个特定isdn接口的状态Show memory 显示路由器内存的大小,包括空闲内存的大小Show processes 显示路由器的进程Show protocols 显示设置的协议Show protocols 显示配置的协议。

cisco思科命令大全

cisco思科命令大全

思科命令大全思科常用命令大权1用户模式2:特权模式enableshow vlanshow versionshow interfaceshow mac-address-tableshow running-configcopy running-config startup-config3:全局配置模式config terminalhostnameenable passwordip default-gateway4:接口配置模式interface 端口switchport mode trunk5:line模式line console 0第2章交换机的基本配置1.配置主机hostname2.查看交换机的配置show running-config使能口令enable password加密保存的使能口令enable secret配置IP地址interface vlan1ip addressno shutdown配置交换机的网关ip default-gateway ipaddress查看交换机的MAC地址表show mac-address-table使用CDP协议show cdpshow cdp interfaceshow cdp neighborsshow cdp neighbors detailshow cdp traffic保存与删除交换机配置copy running-config startup-config第三章:虚拟局域网(VLAN)VLAN的概述VLAN是对连接在第2层交换机端口的网络用户的逻辑分段。

VLAN的作用:1。

广播控制2。

安全(副产品)3。

带宽利用4。

延迟VLAN的种类静态:基于端口的VLAN动态:基于MAC地址的VLAN在交换机上配置静态VLAN创建VLAN1。

CONFIG TERMINALVLAN 2NAME 22。

特权模式下VLAN DATABASEVLAN 2 NAME 2查看VLANSHOW VLAN删除VLANNO VLAN 2验证:SHOW VLAN BRIEF在VLAN中添加端口INTERFACE F0/2INTERFACE RANGE F0/2 - 5SWITCHPORT MODE ACCESSSWITCHPORT ACCESS VLAN 2VLAN配置实例在交换机上添加VLAN2,VLAN3,VLAN3,端口范围分别为1-4,5-8,9-12这个实例的作用就是让不同的VLAN的计算机之间的通信隔开。

cisco命令大全

cisco命令大全

思科命令复习路由器配置视图模式介绍:普通视图 router>特权视图 router# /在普通模式下输入enable全局视图 router(config)# /在特权模式下输入config t接口视图 router(config-if)# /在全局模式下输入int 接口名称例如int s0或int e0路由协议视图 router(config-route)# /在全局模式下输入router 动态路由协议名称1、基本配置:router>enable /进入特权模式router#conf t /进入全局配置模式router(config)# hostname xxx /设置设备名称就好像给我们的计算机起个名字router(config)#enable password xxx /设置特权口令router(config)#no ip domain lookup /不允许路由器缺省使用DNS解析命令router(config)# Service password-encrypt /对所有在路由器上输入的口令进行暗文加密router(config)#line vty 0 4 /进入设置telnet服务模式router(config-line)#password xxx /设置telnet的密码router(config-line)#login /使能可以登陆router(config)#line con 0 /进入控制口的服务模式router(config-line)#password xxx /要设置console的密码router(config-line)#login /使能可以登陆2、接口配置:router(config)#int s0 /进入接口配置模式 serial 0 端口配置(如果是模块化的路由器前面加上槽位编号,例如serial0/0 代表这个路由器的0槽位上的第一个接口)router(config-if)#ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx /添加ip 地址和掩码router(config-if)#enca hdlc/ppp 捆绑链路协议 hdlc 或者 ppp 思科缺省串口封装的链路层协议是HDLC所以在show run配置的时候接口上的配置没有,如果要封装为别的链路层协议例如PPP/FR/X25就是看到接口下的enca ppp或者enca frrouter(config)#int loopback /建立环回口(逻辑接口)模拟不同的本机网段router(config-if)#ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx /添加ip 地址和掩码给环回口在物理接口上配置了ip地址后用no shut启用这个物理接口反之可以用shutdown管理性的关闭接口3、一般的常用命令router(config-if)#exitrouter(config)#router(config-router)#exitrouter(config)#router(config-line)#exitrouter(config)#router(config)#exitrouter#exit命令 /从接口、协议、line等视图模式下退回到全局配置模式,或从全局配置模式退回到特权模式router(config-if)#endrouter(config-router)#endrouter(config-line)#endrouter#end命令 /从任何视图直接回到特权模式router#Logout /退出当前路由器登陆模式相对与windows的注销router#reload /重新启动路由器(热启动)冷启动就是关闭路由器再打开电源开关特权模式下:router#show ip route /查看当前的路由表router#clear ip route * /清楚当前的路由表router#show protocols /显示出所有的被动路由协议和接口上哪些协议被设置router#show ip protocol /查看当前路由器运行的动态路由协议情况router#show ip int brief /查看当前的路由器的接口ip地址启用情况router#show running-config /查看当前运行配置router#show startup-config /查看启动配置router#debug ip +协议 /动态查看路由更新信息router#undebug all /闭所有DEBUG信息router#debug ip pack /打开ip报文的调试router#terminal monitor /输出到终端上显示调试信息router#Show interfaces /显示设置在路由器和访问服务器上所有接口的统计信息. 显示路由器上配置的所有接口的状态router#Show interfaces serial /显示关于一个串口的信息router#Show ip interface /列出一个接口的IP信息和状态的小结, 列出接口的状态和全局参数4、路由配置:(1)静态路由router(config)#ip route xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx xxx/目标网络和掩码还有下一跳地址router(config)#ip route 0.0.0.0 0.0.0.0 s 0 添加缺省路由(2)动态路由rip协议router(config)#router rip /启动rip协议router(config-router)#network xxx.xxx.xxx.xxx /宣告自己的网段router(config-router)#version 2 转换为rip 2版本,默认是rip 1版本router(config-router)#no auto-summary /关闭自动汇总功能,rip V2才有作用router(config-router)# passive-int 接口名 /启动本路由器的那个接口为被动接口router(config-router)# neighbor xxx.xxx.xxx.xxx /广播转单播报文,指定邻居的接ipigrp协议router(config)#router igrp xxx /启动igrp协议router(config-router)#network xxx.xxx.xxx.xxx /宣告自己的网段router(config-router)#variance xxx /调整倍数因子,使用不等价的负载均衡eigrp协议router(config)router eigrp xxx /启动协议router(config-router)#network xxx.xxx.xxx.xxx /宣告自己的网段router(config-router)#variance xxx /调整倍数因子,使用不等价的负载均衡router(config-router)#no auto-summary /关闭自动汇总功能router#Show ip eigrp int /查看哪个接口宣告进了EIGRProuter(config-router)#timers active-time 4 /改变或关闭缺省的3min的活动状态计时router#Show ip eigrp nei /查看邻居表router#Show ip eigrp topology /查看拓扑表router#Show ip eigrp topology all-links /查看不是可行后继router#show ip eigrp traffic /查看发送包数量router(config-if)#ip summary-address eigrp 1 192.168.0.0 255.255.240.0 /接口下汇总EIGRP认证:router (config)#key chain ccie /配置密钥的名字router (config-keychain)#key 1 /密钥序列号router (config-keychain-key)#key-string abc /密码router (config)#int s0/0router (config-if)#ip authentication mode eigrp 1 md5 /接口使用md5加密router (config-if)#ip authentication key-chain eigrp 1 ccie /接口调用密钥router (config-keychain-key)#send-lifetime 00:00:00 1 mar 2012 00:00:00 3 mar 2012 /配置密钥的生存时间router (config-router)Paaive-interface s0/1 /被动接口的配置ospf协议router(config)router ospf xxx /启动协议启动一个OSPF协议进程router(config-router)network xxx.xxx.xxx.xxx area xxx /宣告自己的接口或网段在ospf的区域中可以把不同接口宣告在不同区域中router(config-router)router-id xxx.xxx.xxx.xxx /配置路由的idrouter(config-router)aera xxx stub /配置xxx区域为末梢区域加入这个区域的路由器全部要配置这个条命令router(config-router)aera xxx stub no-summary /配置xxx区域为完全末梢区域只在ABR上配置router(config-router)aera xxx nssa /配置xxx区域为非纯末梢区域加入这个区域的路由器全部要配置这个条命令router(config-router)aera xxx nssa no-summary /配置xxx区域为完全非纯末梢区域只在ABR上配置,并发布缺省路由信息进入这个区域内的路由器router #show ip ospf interface /查看哪些接口被宣告进OSPF进程router #show ip ospf int brief /查看接口运行OSPF的简要信息router #show ip ospf neighbor /查看OSPF的邻居表router #show ip protocol /查OSPF配置信息router #show ip ospf /查看完整的OSPF信息router #show ip database /查看OSPF数据库router (config-router)#maximum-paths /修改OSPF的负载均衡条数router (config-router)#Area 1 range 192.168.10.0 255.255.255.0 /区域间的路由汇总router (config-router)#summary-address 192.168.10.0 255.255.255.0 /外部路由汇总router #show run | b router ospf /查看OSPF配置router (config-router)#area 1 default-cost 10 /为BR路由器发送到一个末梢区域的缺省路由指定一个代价值router#clear ip ospf process /清楚当前路由器ospf协议的进程OSPF加密:router (config-if)#ip ospf authentication-key ccnp /接口下配置明文密钥router (config-router)#area 0 authentication /协议下调用明文密钥router (config-if)#ip ospf message-digest-key 1 md5 ccnp /接口下配置MD5密钥router (config-router)#area 0 authentication message-digest /协议下调用MD5密钥5、保存当前修改/运行的配置:router#write /将RAM中的当前配置存储到NVRAM中,下次路由器启动就是执行保存的配置router#Copy running-config startup-config /命令与write效果一样6 ACL配置router(config)#access-list (1~99)(deny/permit)(源地址)(反掩码)(log) /标准访问列表router(config)#access-list (100~199)(deny/permit)(协议)(源地址)(反掩码)(目的地址)(反掩码)(端口号)(log) / 扩展访问列表router(config)#ip access-list {standard | extended(扩展)} ( name ) 命名访问列表router#access-enable /允许路由器在动态访问列表中创建临时访问列表入口router (config-if)#ip access-group xxx /把访问控制列表(ACL)应用到接口上router (config-line)#access-class xxx {in/out} / VTY上调用ACLrouter#show ip access-list /查看aclrouter (config)#access-list / 定义一个标准的IP ACL交换机配置1、基本配置:Switch >enable /进入特权模式Switch#conf t /进入全局配置模式Switch (conf-if)#duplex full/half/auto /有full , half, auto 三个可选switch# erase startup-configure / 恢复出场配置switch# reload / 重启交换机远程登录和con口还有接口配置和路由器配置命令一样,不再下面总结。

思科路由器命令大全

思科路由器命令大全

思科路由器命令大全思科路由器命令大全1.基本设置命令1.1 主机名配置●hostname [主机名]:设置路由器的主机名。

1.2 用户名和密码配置●enable password [密码]:设置特权模式的密码。

●enable secret [密码]:设置加密的特权模式密码。

●username [用户名] password [密码]:创建一个本地用户并设置密码。

●line console 0:进入控制台命令行配置模式。

●password [密码]:设置控制台访问密码。

●line vty [行号] [结束行号]:进入虚拟终端配置模式。

●password [密码]:设置虚拟终端访问密码。

1.3 IP 地质配置●interface [接口类型] [接口编号]:进入接口配置模式。

●ip address [IP 地质] [子网掩码]:设置接口的IP 地质和子网掩码。

●no shutdown:启用接口。

1.4 默认网关配置●ip default-gateway [默认网关地质]:设置默认网关。

2.路由配置命令2.1 静态路由配置●ip route [目标网络] [目标子网掩码] [下一跳地质]:配置静态路由。

2.2 动态路由配置●router rip:进入 RIP 路由配置模式。

●network [网络地质]:启动 RIP 并指定要进行路由的网络地质。

●router ospf [进程号]:进入 OSPF 路由配置模式。

●network [IP 地质] [反掩码] area [区域号]:配置 OSPF。

3.状态和监控命令3.1 接口状态命令●show ip interface brief:显示路由器接口的 IP 地质和状态。

●show interfaces [接口类型] [接口编号]:显示指定接口的详细信息。

●show interfaces status:显示接口的状态和统计信息。

3.2 路由表命令●show ip route:显示路由表信息。

【路由备忘】Cisco命令大全

【路由备忘】Cisco命令大全

1 #show ?access-expression 显示访问控制表达式access-lists 显示访问控制表apollo Apollo 网络信息appletalk Apple Talk 信息arap 显示Appletalk 远端通道统计arp 地址解析协议表async 访问路由接口的终端行上的信息bridge 前向网络数据库buffers 缓冲池统计clns CLNS网络信息clock 显示系统时钟cmns 连接模式网络服务信息compress 显示压缩状态configuration 非易失性内存的内容controllers 端口控制状态debugging 调试选项状态decnet DEC网络信息dialer 拨号参数和统计dnsix 显示Dnsix/DMPP信息entry 排队终端入口extended 扩展端口信息flash 系统闪烁信息flh-log 闪烁装载帮助日志缓冲区frame-relay 帧中继信息history 显示对话层历史命令hosts IP域名,查找方式,名字服务,主机表interfaces 端口状态和设置ip IP信息ipx Novell IPX信息isis IS-IS路由信息keymap 终端键盘映射lat DEC LAT信息line 终端行信息llc2 IBM LLC2 环路信息lnm IBM 局网管理local-ack 本地认知虚环路memory 内存统计netbios-cache NetBios命名缓冲存贮器内存node 显示已知LAT节点ntp 网络时间协议processes 活动进程统计protocols 活动网络路由协议queue 显示队列内容queueing 显示队列设置registry 功能注册信息rhosts 远程主机文件rif RIF存贮器入口route-map 路由器信息sdlle 显示sdlc-llc2转换信息services 已知LAT服务sessions 远程连接信息smds SMDS信息source-bridge 源网桥参数和统计spanning-tree 跨越树形拓朴stacks 进程堆栈应用standby 热支持协议信息stun STUN状态和设置subsystem 显示子系统tcp TCP连接状态terminal 显示终端设置tn3270 TN3270 设置translate 协议转换信息ttycap 终端容易表users 显示终端行的信息version 系统硬、软件状态vines VINES信息whoami 当前终端行信息x25 X.25信息xns XNS信息xermote Xremote统计2 (config)#ipGlobal IP configuration subcommands:Accounting-list 选择保存IP记帐信息的主机Accounting-threshold 设置记帐入口的最大数accounting-transits 设置通过入口的最大数alias TCP端口的IP地址取别名as-path BGP自治系统路径过滤cache-invalidate-delay 延迟IP路由存贮池的无效classless 跟随无类前向路由规则default-network 标志网络作为缺省网关候选default-gateway 指定缺省网(如果没有路由IP)domain-list 完成无资格主机的域名domain-lookup 打开IP域名服务系统主机转换domain-name 定义缺省域名forward-protocol 控制前向的、物理的、直接的IP广播host 为IP主机表增加一个入口host-routing 打开基于主机的路由(代理ARP和再定向)hp-host 打开HP代理探测服务mobile-host 移动主机数据库multicast-routing 打开前向IPname-server 指定所用名字服务器的地址ospf-name-lookup 把OSPF路由作为DNS名显示pim PIM 全局命令route 建立静态路由routing 打开IP路由security 指定系统安全信息source-route 根据源路由头的选择处理包subnet-zero 允许子网0子网tcp 全局TCP参数3 Exec commands:<1-99> 恢复一个会话bfe 手工应急模式设置clear 复位功能clock 管理系统时钟configure 进入设置模式connect 打开一个终端copy 从tftp服务器拷贝设置文件或把设置文件拷贝到tftp服务器上debug 调试功能disable 退出优先命令状态disconnect 断开一个网络连接enable 进入优先命令状态erase 擦除快闪内存exit 退出exce模式help 交互帮助系统的描述lat 打开一个本地传输连接lock 锁定终端login 以一个用户名登录logout 退出终端mbranch 向树形下端分支跟踪多路由广播mrbranch 向树形上端分支跟踪反向多路由广播name-connection 给一个存在的网络连接命名no 关闭调试功能pad 打开X.29 PAD连接ping 发送回显信息ppp 开始点到点的连接协议reload 停机并执行冷启动resume 恢复一个活动的网络连接rlogin 打开远程注册连接rsh 执行一个远端命令send 发送信息到另外的终端行setup 运行setup命令show 显示正在运行系统信息slip 开始SLIP协议start-chat 在命令行上执行对话描述systat 显示终端行的信息telnet 远程登录terminal 终端行参数test 测试子系统内存和端口tn3270 打开一个tin3270连接trace 跟踪路由到目的地undebug 退出调试功能verify 验证检查闪烁文件的总数where 显示活动的连接which-route 执行OSI路由表查找并显示结果write 把正在运行的设置写入内存、网络、或终端x3 在PAD上设置X.3参数xremote 进入xremote模式4 #config ?Memory 从非易失性内存设置Network 从TFTP网络主机设置Overwrite-network 从TFTP网络主机设置覆盖非易失性内存Terminal 从终端设置5 Configure commads:Access-list 增加一个访问控制域Apollo Apollo全局设置命令appletalk Appletalk 全局设置命令arap Appletalk远程进出协议arp 设置一个静态ARP入口async-bootp 修改系统启动参数autonomous-system 本地所拥有的特殊自治系统成员banner 定义注册显示信息boot 修改系统启动时参数bridge 透明网桥buffers 调整系统缓冲池参数busy-message 定义当连接主机失败时显示信息chat-s cript 定义一个调制解调器对话文本clns 全局CLNS设置子命令clock 设置时间时钟config-register 定义设置寄存器decnet 全局DEC网络设置子命令default-value 缺省字符位值dialer-list 创建一个拨号清单入口dnsix-nat 为审计提供DMDM服务enable 修改优先命令口令end 从设置模式退出exit 从设置模式退出frame-relay 全局帧中继设置命令help 交互帮助系统的描述hostname 设置系统网络名iterface 选择设置的端口ip 全局地址设置子命令ipx Novell/IPX全局设置命令keymap 定义一个新的键盘映射lat DEC本地传输协议line 设置终端行lnm IBM局网管理locaddr-priority-list 在LU地址上建立优先队列logging 修改注册(设备)信息login-string 定义主机指定的注册字符串map-class 设置静态表类map-list 设置静态表清单menu 定义用户接口菜单mop 设置DEC MOP服务器netbios NETBIOS通道控制过滤no 否定一个命令或改为缺省设置ntp 设置NTPpriority-list 建立特权列表prompt 设置系统提示符queue-list 建立常规队列列表rcmd 远程命令设置命令rcp-enable 打开Rep服务rif 源路由进程router-map 建立路由表或进入路由表命令模式router 打开一个路由进程rsh-enable 打开一个RSH服务sap-priority-list 在SAP或MAC地址上建立一个优先队列service 修改网络基本服务snmp-server 修改SNMP参数state-machine 定义一个TCP分配状态的机器stun STUN全局设置命令tacacs-server 修改TACACS队列参数terminal-queue 终端队列命令tftp-server 为网络装载请求提供TFTP服务tn3270 tn3270设置命令translate 解释全局设置命令username 建立一个用户名及其权限vines VINES全局设置命令x25 X.25 的第三级x29 X.29 命令xns XNS 全局设置命令xremote 设置Xremote配置实例:Cisco2501有一个以太网口(AUI)、一个Console口(RJ45)、一个AUX口(RJ45)和两个同步串口,支持DTE和DCE设备,支持EIA/TIA-232、EIA/TIA-449、V.35 、X.25和EIA-530接口。

CISCO-思科命令

CISCO-思科命令

1.switch配置命令(1)模式转换命令用户模式----特权模式,使用命令"enable"特权模式----全局配置模式,使用命令"config t"全局配置模式----接口模式,使用命令"interface+接口类型+接口号" 全局配置模式----线控模式,使用命令"line+接口类型+接口号"注:用户模式:查看初始化的信息.特权模式:查看所有信息、调试、保存配置信息全局模式:配置所有信息、针对整个路由器或交换机的所有接口接口模式:针对某一个接口的配置线控模式:对路由器进行控制的接口配置(2)配置命令show running config 显示所有的配置show versin 显示版本号和寄存器值shut down 关闭接口no shutdown 打开接口ip add +ip地址配置IP地址secondary+IP地址为接口配置第二个IP地址show interface+接口类型+接口号查看接口管理性show controllers interface 查看接口是否有DCE电缆show history 查看历史记录show terminal 查看终端记录大小hostname+主机名配置路由器或交换机的标识config memory 修改保存在NVRAM中的启动配置exec timeout 0 0 设置控制台会话超时为0service password-encryptin 手工加密所有密码enable password +密码配置明文密码ena sec +密码配置密文密码line vty 0 4/15 进入telnet接口password +密码配置telnet密码line aux 0 进入AUX接口password +密码配置密码line con 0 进入CON接口password +密码配置密码bandwidth+数字配置带宽no ip address 删除已配置的IP地址show startup config 查看NVRAM中的配置信息copy run-config atartup config 保存信息到NVRAMwrite 保存信息到NVRAMerase startup-config 清除NVRAM中的配置信息show ip interface brief 查看接口的谪要信息banner motd # +信息+ # 配置路由器或交换机的描素信息description+信息配置接口听描素信息vlan database 进入VLAN数据库模式vlan +vlan号+ 名称创建VLANswitchport access vlan +vlan号为VLAN为配接口interface vlan +vlan号进入VLAN接口模式ip add +ip地址为VLAN配置管理IP地址vtp+service/tracsparent/client 配置SW的VTP工作模式vtp +domain+域名配置SW的VTP域名vtp +password +密码配置SW的密码switchport mode trunk 启用中继no vlan +vlan号删除VLANshow spamming-tree vlan +vlan号查看VLA怕生成树议2. 路由器配置命令ip route+非直连网段+子网掩码+下一跳地址配置静态/默认路由show ip route 查看路由表show protocols 显示出所有的被动路由协议和接口上哪些协议被设置show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用的定时器等信息router rip 激活RIP协议network +直连网段发布直连网段interface lookback 0 激活逻辑接口passive-interface +接口类型+接口号配置接口为被动模式debug ip +协议动态查看路由更新信息undebug all 关闭所有DEBUG信息router eigrp +as号激活EIGRP路由协议network +网段+子网掩码发布直连网段show ip eigrp neighbors 查看邻居表show ip eigrp topology 查看拓扑表show ip eigrp traffic 查看发送包数量router ospf +process-ID 激活OSPF协议network+直连网段+area+区域号发布直连网段show ip ospf 显示OSPF的进程号和ROUTER-ID encapsulation+封装格式更改封装格式no ip admain-lookup 关闭路由器的域名查找ip routing 在三层交换机上启用路由功能show user 查看SW的在线用户clear line +线路号清除线路3. 三层交换机配置命令配置一组二层端口configure terminal 进入配置状态nterface range {port-range} 进入组配置状态配置三层端口configure terminal 进入配置状态interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} | {port-channel port-channel-number} 进入端口配置状态no switchport 把物理端口变成三层口ip address ip_address subnet_mask 配置IP地址和掩码no shutdown 激活端口例:Switch(config)# interface gigabitethernet0/2Switch(config-if)# no switchportSwitch(config-if)# ip address 192.20.135.21 255.255.255.0Switch(config-if)# no shutdown配置VLANconfigure terminal 进入配置状态vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改。

cisco常用命令

cisco常用命令

cisco常⽤命令进⼊特权模式Router>enable进⼊配置模式Router#configure terminal特权模式下查看全局配置Router#show running-config⾮特权模式下查看全局配置(+do 在⾮特权模式下使⽤do show查看配置)Router(config)#do show running-config重启Router#reload保存配置Router#write清空配置Router#write erase删除命令Router(config-if)#no ip address修改主机名Router(config)#hostname R1设置进⼊特权模式的密码Router(config)#enable password cisco@123设置远程登录line vty 0 4password cisco@123login //允许登录transport input telnet //允许通过的协议远程登录时查看⽇志信息Router#terminal monitor路由功能Switch(config)#ip routing //开启路由功能Switch(config)#no ip routing //关闭路由功能Switch(config)#ip default-gateway 192.168.1.254 //设置默认⽹关查看MAC地址表Switch#show mac address-table设置全/半双⼯Router(config-if)#duplex full/half路由管理距离(类似Huawei 优先级)Router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.1 ?<1-255> Distance metric for this routeProtocol DistanceDirect 0Static 1Rip 120OSPF 110Eigrp 90(170)CDP协议(思科私有,与LLDP相同)Router#show cdp neighborsVLAN,接⼝Switch(config)#vlan 10,20,30 //同时创建多个vlaninterface Ethernet0/1switchport access vlan 10switchport mode accessinterface Ethernet0/2switchport trunk encapsulation dot1q //配置封装模式(Cisco默认私有模式ISL)switchport trunk native vlan 10 //本征vlan(类似华为pvid)switchport mode trunkswitchport trunk allowed vlan allswitchport trunk allowed vlan 10,20switchport trunk allowed vlan remove 10//不允许某个vlan通过⼦接⼝interface Ethernet0/1.10 //创建⼦接⼝encapsulation dot1Q 10 //封装vlan10ip address 192.168.10.1 255.255.255.0DHCPip dhcp excluded-address 192.168.10.250 192.168.10.254ip dhcp pool dhcp-poolnetwork 192.168.10.0 255.255.255.0default-router 192.168.10.254dns-server 114.114.114.114Switch(config-if)#ip helper-address 192.168.20.254 //dhcp中继Router#show ip dhcp conflict //查看地址冲突Router#clear ip dhcp conflict * //清除dhcp冲突地址Router#show dhcp serverACLRouter(config)#access-list 1 permit 192.168.10.1 0.0.0.0 //基本aclRouter(config)#access-list 100 permit tcp 192.168.10.1 0.0.0.0 eq 80 1.1.1.1 0.0.0.0 eq 8000 //扩展acl//基于名称的acl(可以设置规则序号)Router(config)#ip access-list standard ciaco-aclRouter(config-std-nacl)#11 permit 192.168.1.1 0.0.0.0Router(config-if)#ip access-group 1 in/out //在接⼝上应⽤aclNATinterface Ethernet0/0ip address 192.168.10.1 255.255.255.0ip nat inside //内⽹⼈⼝interface Ethernet0/1ip address 200.1.1.1 255.255.255.0ip nat outside //外⽹出⼝access-list 10 permit 192.168.10.0 0.0.0.255ip nat inside source list 10 interface Ethernet0/1 //nat转换ip nat inside source static tcp 192.168.10.23 23 200.1.1.1 23 //端⼝映射链路聚合Switch(config)#interface range ethernet 0/2 - 3 //创建接⼝组(类似port-group)Switch(config-if-range)#channel-group 12 mode active //创建channel id(两端id不需要相同),设置模式 // shutdown状态下配置,如果不成功更换channel idSwitch#show etherchannel summary //查看命令STPSwitch(config)#spanning-tree mode ?mst Multiple spanning tree mode //多⽣成树(802.1s)pvst Per-Vlan spanning tree mode //传统模式(802.1D)rapid-pvst Per-Vlan rapid spanning tree mode //快速⽣成树(802.1w)Switch(config)#spanning-tree vlan 10 priority 0 //设置优先级VTP(思科私有⽤于vlan同步,只⽤于交换机间的接⼝是trunk⼝){vtp是危险协议,推荐修改为透明模式}Switch(config)#vtp mode ?client Set the device to client mode. //客户端模式(⽤于同步配置,不能创建修改删除vlan) off Set the device to off mode. //关闭server Set the device to server mode. //服务器模式(同步配置,可以创建修改删除vlan) transparent Set the device to transparent mode. //透明模式(推荐配置,不会被同步)vtp domain cisco //创建vtp域名vtp version 2 //修改版本(v1,v2,v3存在版本兼容问题)vtp password cisco@123 //设置认证密码HSRP(思科私有,类似vrrp)interface Ethernet0/1ip address 192.168.1.2 255.255.255.0standby 12 ip 192.168.1.254 //设置虚拟IP(standby id 两端必须⼀致)standby 12 priority 110 //设置优先级(默认100,越⼤越优)standby 12 preempt //开启抢占PPPusername admin password 0 cisco@123 //设置⽤户,密码interface Serial1/0ip address 192.168.10.1 255.255.255.0encapsulation ppp //封装为PPPppp authentication chap/pap //认证模式为chap或papinterface Serial1/0ip address 192.168.10.2 255.255.255.0encapsulation pppppp chap hostname adminppp chap password ciaco@123ppp pap sent-username admin password ciaco@123PPPoEServer:bba-group pppoe Ciscovirtual-template 1interface Ethernet0/1no ip addresspppoe enable group Ciscousername admin password 0 cisco@123ip local pool pppoe-pool 200.1.1.2 200.1.1.10 //创建可分配的地址池interface Virtual-Template1ip address 200.1.1.1 255.255.255.0peer default ip address pool pppoe-poolppp authentication chapClient:interface Ethernet0/1no ip addresspppoe enablepppoe-client dial-pool-number 1interface Dialer1ip address negotiatedip mtu 1492 //1500-ppp头部encapsulation pppip tcp adjust-mss 1452 //1500-(ppp头部+ip头部+tcp头部) dialer pool 1ppp authentication chap callin //启⽤chap验证ppp chap hostname adminppp chap password 0 cisco@123GREinterface Tunnel10ip address 10.1.1.1 255.255.255.0tunnel source 1.1.1.1 //本端公⽹IPtunnel destination 2.2.2.2 //对端公⽹IP。

思科命令大全

思科命令大全

思科交换cisco switch 命令大全1.在基于IOS 的交换机上设置主机名/系统名:switch(config)# hostname hostname在基于CLI 的交换机上设置主机名/系统名:switch(enable) set system name name-string2.在基于IOS 的交换机上设置登录口令:switch(config)# enable password level 1 password在基于CLI 的交换机上设置登录口令:switch(enable) set passwordswitch(enable) set enalbepass3.在基于IOS 的交换机上设置远程访问:switch(config)# interface vlan 1switch(config-if)# ip address ip-address netmaskswitch(config-if)# ip default-gateway ip-address在基于CLI 的交换机上设置远程访问:switch(enable) set interface sc0 ip-address netmask broadcast-addressswitch(enable) set interface sc0 vlanswitch(enable) set ip route default gateway4.在基于IOS 的交换机上启用和浏览CDP 信息:switch(config-if)# cdp enableswitch(config-if)# no cdp enable为了查看Cisco 邻接设备的CDP 通告信息:switch# show cdp interface [type modle/port]switch# show cdp neighbors [type module/port] [detail]在基于CLI 的交换机上启用和浏览CDP信息:switch(enable) set cdp {enable|disable} module/port为了查看Cisco 邻接设备的CDP 通告信息:switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail]5.基于IOS的交换机的端口描述:switch(config-if)# description description-string基于CLI 的交换机的端口描述:switch(enable)set port name module/number description-string6.在基于IOS 的交换机上设置端口速度:switch(config-if)# speed{10|100|auto}在基于CLI 的交换机上设置端口速度:switch(enable) set port speed moudle/number {10|100|auto}switch(enable) set port speed moudle/number {4|16|auto}7.在基于IOS 的交换机上设置以太网的链路模式:switch(config-if)# duplex {auto|full|half}在基于CLI 的交换机上设置以太网的链路模式:switch(enable) set port duplex module/number {full|half}8.在基于IOS 的交换机上配置静态VLAN:switch# vlan databaseswitch(vlan)# vlan vlan-num name vlaswitch(vlan)# exit switch# configure teriminalswitch(config)# interface interface module/numberswitch(config-if)# switchport mode accessswitch(config-if)# switchport access vlan vlan-numswitch(config-if)# end在基于CLI 的交换机上配置静态VLAN:switch(enable) set vlan vlan-num [name name]switch(enable) set vlan vlan-num mod-num/port-list9. 在基于IOS 的交换机上配置VLAN中继线:switch(config)# interface interface mod/portswitch(config-if)# switchport mode trunkswitch(config-if)# switchport trunk encapsulation {isl|dotlq}switch(config-if)# switchport trunk allowed vlan remove vlan-listswitch(config-if)# switchport trunk allowed vlan add vlan-list在基于CLI 的交换机上配置VLAN中继线:switch(enable) set trunk module/port [on|off|desirable|auto|nonegotiate]Vlan-range [isl|dotlq|dotl0|lane|negotiate]10.在基于IOS 的交换机上配置VTP管理域:switch# vlan databaseswitch(vlan)# vtp domain domain-name在基于CLI 的交换机上配置VTP 管理域:switch(enable) set vtp [domain domain-name]11.在基于IOS 的交换机上配置VTP 模式:switch# vlan databaseswitch(vlan)# vtp domain domain-nameswitch(vlan)# vtp {sever|cilent|transparent}switch(vlan)# vtp password password在基于CLI 的交换机上配置VTP 模式:switch(enable) set vtp [domain domain-name] [mode{ sever|cilent|transparent }][password password]12. 在基于IOS 的交换机上配置VTP版本:switch# vlan databaseswitch(vlan)# vtp v2-mode在基于CLI 的交换机上配置VTP 版本:switch(enable) set vtp v2 enable13. 在基于IOS 的交换机上启动VTP剪裁:switch# vlan databaseswitch(vlan)# vtp pruning在基于CL I 的交换机上启动VTP 剪裁:switch(enable) set vtp pruning enable14.在基于IOS 的交换机上配置以太信道:switch(config-if)# port group group-number [distribution {source|destination}]在基于CLI 的交换机上配置以太信道:switch(enable) set port channel moudle/port-range mode{on|off|desirable|auto}15.在基于IOS 的交换机上调整根路径成本:switch(config-if)# spanning-tree [vlan vlan-list] cost cost 在基于CLI 的交换机上调整根路径成本:switch(enable) set spantree portcost moudle/port costswitch(enable) set spantree portvlancost moudle/port [cost cost][vlan-list]16.在基于IOS 的交换机上调整端口ID:switch(config-if)# spanning-tree[vlan vlan-list]port-priority port-priority在基于CLI 的交换机上调整端口ID:switch(enable) set spantree portpri {mldule/port}priorityswitch(enable) set spantree portvlanpri {module/port}priority [vlans]17. 在基于IOS 的交换机上修改STP时钟:switch(config)# spanning-tree [vlan vlan-list] hello-time secondsswitch(config)# spanning-tree [vlan vlan-list] forward-time seconds` switch(config)# spanning-tree [vlan vlan-list] max-age seconds在基于CLI 的交换机上修改STP时钟:switch(enable) set spantree hello interval[vlan]switch(enable) set spantree fwddelay delay [vlan]switch(enable) set spantree maxage agingtiame[vlan]18. 在基于IOS 的交换机端口上启用或禁用Port Fast 特征:switch(config-if)#spanning-tree portfast在基于CLI 的交换机端口上启用或禁用Port Fast 特征:switch(enable) set spantree portfast {module/port}{enable|disable}19. 在基于IOS 的交换机端口上启用或禁用UplinkFast 特征:switch(config)# spanning-tree uplinkfast [max-update-rate pkts-per-second]在基于CLI 的交换机端口上启用或禁用UplinkFast 特征:switch(enable) set spantree uplinkfast {enable|disable}[rate update-rate] [all-protocols off|on]20. 为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个IP 地址,然后使用下列命令:switch(config)# cluster enable cluster-name21. 为了从一条中继链路上删除VLAN,可使用下列命令:switch(enable) clear trunk module/port vlan-range22. 用show vtp domain 显示管理域的VTP 参数.23. 用show vtp statistics显示管理域的VTP 参数.24. 在Catalyst 交换机上定义TrBRF的命令如下:switch(enable) set vlan vlan-name [name name] type trbrf bridge bridge-num[stp {ieee|ibm}]25. 在Catalyst 交换机上定义TrCRF 的命令如下:switch (enable) set vlan vlan-num [name name] type trcrf{ring hex-ring-num|decring decimal-ring-num} parent vlan-num26. 在创建好TrBRF VLAN之后,就可以给它分配交换机端口.对于以太网交换,可以采用如下命令给VLAN分配端口:switch(enable) set vlan vlan-num mod-num/port-num27. 命令show spantree显示一个交换机端口的STP状态.28. 配置一个ELAN的LES 和BUS,可以使用下列命令:A TM (config)# interface atm number.subint multiointA TM(config-subif)# lane serber-bus ethernet elan-name29. 配置LECS:A TM(config)# lane database database-nameA TM(lane-config-databade)# name elan1-name server-atm-address les1-nsap-addressA TM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-addressA TM(lane-config-databade)# name …30. 创建完数据库后,必须在主接口上启动LECS.命令如下:A TM(config)# interface atm numberA TM(config-if)# lane config database database-nameA TM(config-if)# lane config auto-config-atm-address31. 将每个LEC配置到一个不同的A TM 子接口上.命令如下:A TM(config)# interface atm number.subint multipointA TM(config)# lane client ethernet vlan-num elan-num32. 用show lane server 显示LES 的状态.33. 用show lane bus 显示bus 的状态.34. 用show lane database显示LECS 数据库可内容.35. 用show lane client 显示LEC的状态.36. 用show module显示已安装的模块列表.37. 用物理接口建立与VLAN的连接:router# configure terminalrouter(config)# interface media module/portrouter(config-if)# description description-stringrouter(config-if)# ip address ip-addr subnet-maskrouter(config-if)# no shutdown38. 用中继链路来建立与VLAN的连接:router(config)# interface module/port.subinterfacerouter(config-ig)# encapsulation[isl|dotlq] vlan-numberrouter(config-if)# ip address ip-address subnet-mask39. 用LANE 来建立与VLAN的连接:router(config)# interface atm module/portrouter(config-if)# no ip addressrouter(config-if)# atm pvc 1 0 5 qsaalrouter(config-if)# atm pvc 2 0 16 ilnirouter(config-if)# interface atm module/port.subinterface multipointrouter(config-if)# ip address ip-address subnet-maskrouter(config-if)# lane client ethernet elan-numrouter(config-if)# interface atm module/port.subinterface multipointrouter(config-if)# ip address ip-address subnet-namerouter(config-if)# lane client ethernet elan-name router(config-if)# …40. 为了在路由处理器上进行动态路由配置,可以用下列IOS 命令来进行: router(config)# ip routingrouter(config)# router ip-routing-protocolrouter(config-router)# network ip-network-numberrouter(config-router)# network ip-network-number41. 配置默认路由:switch(enable) set ip route default gateway42. 为一个路由处理器分配VLANID,可在接口模式下使用下列命令:router(config)# interface interface numberrouter(config-if)# mls rp vlan-id vlan-id-num43. 在路由处理器启用MLSP:router(config)# mls rp ip44. 为了把一个外置的路由处理器接口和交换机安置在同一个VTP 域中:router(config)# interface interface numberrouter(config-if)# mls rp vtp-domain domain-name45. 查看指定的VTP域的信息:router# show mls rp vtp-domain vtp domain name46. 要确定RSM 或路由器上的管理接口,可以在接口模式下输入下列命令:router(config-if)#mls rp management-interface47. 要检验MLS-RP 的配置情况:router# show mls rp48. 检验特定接口上的MLS 配置:router# show mls rp interface interface number49. 为了在MLS-SE 上设置流掩码而又不想在任一个路由处理器接口上设置访问列表:set mls flow [destination|destination-source|full]50. 为使MLS 和输入访问列表可以兼容,可以在全局模式下使用下列命令:router(config)# mls rp ip input-aclTOPampm中级用户• 个人空间• 发短消息• 加为好友• 当前离线2# 大中小发表于2006-11-28 20:39 只看该作者51. 当某个交换机的第3 层交换失效时,可在交换机的特权模式下输入下列命令:switch(enable) set mls enable52. 若想改变老化时间的值,可在特权模式下输入以下命令:switch(enable) set mls agingtime agingtime53. 设置快速老化:switch(enable) set mls agingtime fast fastagingtime pkt_threshold54. 确定那些MLS-RP 和MLS-SE参与了MLS,可先显示交换机引用列表中的内容再确定:switch(enable) show mls include55. 显示MLS 高速缓存记录:switch(enable) show mls entry56. 用命令show in arp显示ARP 高速缓存区的内容。

Cisco命令大全

Cisco命令大全

cisco交换机命令大全(一)switch>enable 进入特权模式switch#config terminal 进入全局配置模式switch(config)#hostname 设置交换机的主机名switch(config)#enable secret xxx 设置特权加密口令switch(config)#enable password xxa设置特权非密口令使用Telnet远程式管理switch(config)#interface vlan 1 进入vlan 1switch(config-if)#ip address 设置IP地址switch(config-if)#ip default-gateway 设置默认网关switch(config)#line vty 0 4 进入虚拟终端switch(config-line)#login 允许登录switch(config-line)#password xx 设置登录口令switch#exit返回命令控制台口令switch(config)#line console 0 进入控制台口switch(config-line)#login 允许登录switch(config-line)#password xx 设置登录口令switch#exit返回命令基本接口配置switch(config)#interface f0/1 进入f0/1接口switch(config-if)#duplex full 配置全双工模式switch(config-if)#speed 100 配置速率switch(config-if)#description to ***** 接口描述switch(config)#ip domain-name ***.com 设置或名服务器switch(config)#mac-address-table aging-time 设置mac表超时时间switch#write保存配置信息switch#copy running-config startup-config保存当前配置nvramswitch#erase startup-config清除配置文件交换机VLAN设置:switch#vlan database 进入VLAN设置switch(vlan)#vlan 2 建VLAN 2switch(vlan)#name 名字建VLAN 2的名称switch(vlan)#no vlan 2 删vlan 2注:删除vlan时原属于此vlan的端口处于非激活状态,直到重新分配为止switch(config)#int f0/1 进入端口1switch(config-if)#switchport mode access 当前端口工作莫试switch(config-if)#switchport access vlan 2 当前端口加入vlan 2switch(config-if)#switchport mode trunk 设置为干线switch(config-if)#switchport trunk encapsulation dot1q 设置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 remove 1,2 ;从Trunk中删除vlansswitch(config-if)#switchport trunk pruning vlan remove 1,2 ;从Trunk中关闭局部修剪以太网通道配置switch(config)#interface range fasternet0/1 - 2 将fasternet0/1和0/2 口捆绑(成双不成单)switch(config-if)#channel-group 1 mode on 配置以太通道模式switch(config-if)#port-channel load-balance {dst-mac | src-mac}在链路间实现负载均衡switch#showetherchannel 1 summary 查看通道信息switch#showetherchannel load-balance 查看通道信息vtp配置switch(config)#vtp domain 设置vtp域名switch(config)#vtp password 设置vtp密码switch(config)#vtp mode server 设置vtp服务器模式switch(config)#vtp mode client 设置vtp客户机模式switch(config)#vtp mode transparent 设置vtp透明模式switch(config)#vtp version 设置vtp版本switch(config)#vtp pruning 启用vtp修解switch(config)#no vtp pruning 关闭vtp修解注:要想从vtp中减少一台交换机只需将该交换机vtp名更改生成树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 指定交换机优先级(基于vlan)switch(config)#no spanning-tree vlan priority 将交换机的优先级恢复默认值(基于vlan) switch(config-if)#spanning-tree vlan cost 指定端口成本(起用trunk的端口模式下)switch(config-if)#spanning-tree vlan port-prioty指定交换机端口优先级(基于vlan)switch(config-if)#spanning-tree portfast配置速端口(连接终端设备的端口状态)如pc机switch(config)#spanning-tree uplinkfast配置上行速端口注:在配置上行速端口前要先将基于vlan上的网桥优先级,网桥成本恢复默认值。

思科路由器命令大全完整版

思科路由器命令大全完整版

思科路由器命令大全完整版一、基本配置命令1、`enable`:进入特权模式。

2、`configure terminal`:进入全局配置模式。

3、`hostname 主机名`:设置路由器的主机名。

4、`interface 接口类型接口编号`:进入指定接口的配置模式,例如`interface ethernet 0/0`。

5、`ip address IP 地址子网掩码`:为接口配置 IP 地址和子网掩码。

6、`no shutdown`:启用接口。

二、路由配置命令1、`ip route 目标网络子网掩码下一跳地址`:添加静态路由。

2、`router ospf 进程号`:启用 OSPF 路由协议,并指定进程号。

3、`network 网络地址反掩码 area 区域号`:在 OSPF 中宣告网络。

三、访问控制列表(ACL)命令1、`accesslist 编号 permit|deny 源地址源掩码目的地址目的掩码协议端口`:创建访问控制列表规则。

2、`ip accessgroup 编号 in|out`:将访问控制列表应用到接口的入站或出站方向。

四、NAT 配置命令1、`ip nat inside source list 访问控制列表编号 interface 外部接口overload`:配置 PAT(端口地址转换)。

2、`interface 接口 ip nat inside`:指定接口为内部接口。

3、`interface 接口 ip nat outside`:指定接口为外部接口。

五、VLAN 配置命令1、`vlan VLAN 号`:创建 VLAN。

2、`name VLAN 名称`:为 VLAN 命名。

3、`interface vlan VLAN 号`:进入 VLAN 接口配置模式。

六、端口镜像命令1、`monitor session 会话号source interface 源接口`:指定源端口。

2、`monitor session 会话号 destination interface 目的接口`:指定目的端口。

Cisco常见思科命令总结

Cisco常见思科命令总结

思科路由器|交换机配置命令第一章 实验拓扑、终端服务器配置命令作用R1>enable从用户模式进入特权模式R1#configure terminal进入配置模式R1(config)#interface g0/0进入千兆位以太网接口模式R1(config-if)#ip add 172.16.0.1 255.255.255.0配置接口的IP地址R1(config-if)#no shutdown打开接口R1(config)#line vty 0 4进入虚拟终端vty 0~vty 4R1(config-line)#password cisco配置虚拟终端密码为ciscoR1(config-line)#login用户要进入路由器,需要先进行登录Exit退回到上一级模式R1(config)#enable password cisco配置进入特权模式的密码为cisco,密码不加密End (Ctrl+Z)直接回到特权模式R1#show int g0/0显示g0/0接口信息R1(config)#hostname Terminal-Server配置路由器的主机名为Terminal-ServerR1(config)#enable secret cisco配置进入特权模式的密码为cisco,密码加密R1(config)#no ip domain-lookup路由器不使用DNS服务器解析主机的IP地址R1(config-line)#logging synchonous对路由器上的提示信息进行同步,防止信息干扰我们输入命令R1(config)#no ip routing关闭路由器的路由功能R1(config)#ip default-gateway 10.1.14.254配置路由器访问其他网段时所需的网关R1#show line显示各线路的状态R1(config)#line33 48进入33~38线路模式R1(config-line)#transport input all允许所有协议进入线路R1(config)#int loopback0进入Loopback0环回接口R1(config)#ip host R1 1.1.1.1为1.1.1.1主机起一个主机名R1R1(config)#alias exec crl clear line 33为命令起一个别名R1(config)#privilege exec level 0 clear line把命令clear line 的等级改为0,在用户模式下也可以执行它R1(config)#banner motd设置用户登录路由器时的提示信息第二章 路由器基本配置命令汇总命令作用R1#clock set hh:mm:ss month day year设置路由器的时间R1#show clock显示路由器的时间R1#show history显示历史命令R1#terminal no editing关闭CLI的编辑功能R1#terminal editing打开CLI的编辑功能R1#terminal histroy size 50修改历史命令缓冲区的大小R1#copy running-config startup-config把内存中的配置文件保存到NVRAM中R1(config-if)#clock rate 128000配置串口上的时钟(DCE端)R1#show version显示路由器的IOS版本等信息R1#show running-config显示内存中的配置文件R1#show startup-config显示NVRAM中的配置文件R1#show interface s0/0/0显示接口的信息R1#show flash显示FLASH的有关信息R1#show controllers s0/0/0显示s0/0/0的控制器信息R1#show ip arp显示路由器中的arp表R1#copy running-config tftp把内存中的配置文件复制到TFTP服务器上R1#copy tftp running-config把TFTP服务器上的配置文件复制到内存中R1#copy flash tftp把FLASH中的IOS保存到TFTP服务器上rommon 1>confreg 0x2142在rommon模式下修改配置寄存器的值rommon 1>i (boot)在rommon模式下重启路由器R1#copy startup-config running-config把NVRAM中的配置文件复制到内存中R1(config)#config-register 0x2102修改配置寄存器值为0x2102R1#reload重启路由器R1#delete flash删除FLASH中的IOSR1#copy tftp flash从TFTP服务器上复制IOS到FLASH中rommon 1>tftpdnld在rommon模式下,从TFTP服务器下载IOS R1#show cdp显示CDP运行信息R1#show cdp interface显示CDP在各接口的运行情况R1#show cdp neighbors显示CDP邻居信息R1#show cdp entry R2显示CDP邻居R2的详细信息R1#clear cdp table清除CDP邻居表R1(config-if)#no cdp enable接口下关闭CDPR1(config)#no cdp run / cdp run关闭/打开整个路由器的CDPR1(config)#cdp timer 30CDP每30 s发送一次R1(config)#cdp holdtime 120让邻居为本设备发送的CDP消息保持120 s第三章 静态路由命令汇总命令作用R1(config)#ip route 1.1.1.0 255.255.255.0 s0/1配置静态路由R1#show ip route查看路由表R1(config)#ip classless / no ip classless打开/关闭有类路由功能R1#ping 2.2.2.2 source loopback 0指定源端口进行ping 测试第四章 RIP命令汇总命令作用R1#show ip route查看路由表R1#show ip protocols查看IP路由协议配置和统计信息R1#show ip rip database查看RIP数据库R1#debug ip rip动态查看RIP的更新过程R1#clear ip route *清除路由表R1(config)#router rip启动RIP进程R1(config-router)#network 1.0.0.0通告网络R1(config-router)#version 2定义RIP的版本R1(config-router)#no auto-summary关闭自动汇总R1(config-if)#ip rip send version配置RIP发送的版本R1(config-if)#ip rip receive version配置RIP接收的版本R1(config-router)#passive-interface s0/1配置被动接口R1(config-router)#neighbor A.B.C.D配置单播更新的目标R1(config-if)#ip summary-address rip ip mask配置RIP手工汇总R1(config)#key chain lgm定义钥匙链R1(config-keychain)#key <0-2147483647>配置Key IDR1(config-keychain-key)#key-string cisco配置Key ID的密匙R1(config-if)#ip rip triggered配置触发更新R1(config-if)#ip rip authentication mode md5/text配置认证模式R1(config-if)#ip rip authention key-chain lgm配置认证使用的钥匙链R1(config-router)#timers basic配置更新的计时器R1(config-router)#maximum-paths配置等价路径的最大值R1(config)#ip default-network向网络中注入默认路由第五章 EIGR命令汇总命令作用R1#show ip eigrp neighbors查看EIGRP邻居表R1#show ip eigrp topology查看EIGRP拓扑结构数据库R1#show ip eigrp interface查看运行EIGRP路由协议的接口的状况R1#show ip eigrp traffic查看EIGRP发送和接收到的数据包的统计情况R1#debug eigrp neighbors查看EIGRP动态建立邻居关系的情况R1#debug eigrp packets显示发和接收的EIGRP数据包R1(config-if)#ip hello-interval eigrp配置EIGRP的HELLO发送周期R1(config-if)#ip hold-time eigrp配置EIGRP的HELLO hold时间R1(config)#router eigrp number启动EIGRP路由进程R1(config)#no auto-summary关闭自动汇总R1(config-if)#ip authentication mode eigrp配置EIGRP的认证模式R1(config-if)#ip authentication key-chain eigrp在接口上调用钥匙链R1(config-router)#variance配置非等价负载均衡R1(config-if)#delay <1-16777215>配置接口下的延迟R1(config-if)#bandwidth 100配置接口下的带宽R1(config-if)#ip summary-address eigrp手工路由汇总第六章 OSPF命令汇总命令作用R1#show ip route查看路由表R1#show ip ospf neighbor查看OSPF邻居的基本信息R1#show ip ospf database查看OSPF拓扑结构数据库R1#show ip ospf interface查看OSPF 路由器接口的信息R1#show ip ospf查看OSPF进程及其细节R1#debug ip ospf adj查看OSPF邻接关系创建或中断的过程R1#debug ip ospf events显示OSPF发生的事件R1#debug ip ospf packet显示路由器收到的所有的OSPF数据包R1(config)#router ospf process ID启动OSPF路由进程R1(config-router)#router-id 1.1.1.1配置路由器IDR1(config-router)#network 192.168.1.0 0.0.0.255 area ared id通告网络及网络所在的区域R1(config-if)#ip ospf network broadcast / point-to-point配置接口网络类型R1(config-if)#ip ospf cost <1-65535>配置接口Cost值R1(config-if)#ip ospf hello-interval <1-65535>s配置Hello间隔R1(config-if)#ip ospf dead-interval <1-65535>s配置OSPF邻居的死亡时间R1(config-if)#ip ospf priority <0-255>配置接口优先级R1(config-router)#auto-cost reference-bandwidth <1-4294967>配置参考带宽R1#clear ip ospf process清除OSPF进程R1(config-router)#area area-id authentication启动区域简单口令认证R1(config-if)#ip ospf authentication-key cisco配置认证密码R1(config-router)#area area-id authentication message-digest启动区域MD5认证R1(config-if)#ip ospf message-digest-key <1-255> md5 cisco配置key ID及密匙R1(config-if)#ip ospf authentication启用链路简单口令认证R1(config-if)#ip ospf authentication message-digest启用链路MD5认证R1(config-router)#default-information originate向OSPF区域注入默认路由第七章 HDLC、PPP命令汇总命令作用R1(config-if)#encapsulation hdlc把接口的封装改为HDLCR1(config-if)#encapsulation PPP把接口的封装改为PPPR1(config-if)#ppp pap sent-username R1 password 123PAP认证时,向对方发送用户名R1和密码123 R1(config-if)#ppp authentication pap PPP的认证方式为PAPR1(config-if)#user R1 password 123为对方创建用户R1,密码为123R1#debug ppp authentication打开PPP的认证调试过程R1(config-if)#ppp authentication chap PPP的认证方式为CHAP第八章 帧中继命令汇总命令作用R1(config)#frame-relay switching把路由器当成帧中继交换机R1(config-if)#encapsulation frame-relay接口封装成帧中继R1(config-if)#frame-relay lmi-type cisco配置LMI的类型R1(config-if)#frame-relay intf-type dce配置接口是帧中继的DCE还是DTER1(config-if)#frame-relay route dlci interface s0/0 dlci配置帧中继交换表R1#show frame-relay route显示帧中继交换表R1#show frame pvc显示帧中继PVC状态R1#show frame lmi显示帧中继LMI信息R1#show frame-relay map查看帧中继映射R1(config-if)#no frame-relay inverse-arp关闭帧中继自动映射R1(config-if)#ip split-horizon打开水平分割R1(config)#int s0/0/0.1 multipoint创建点到多点子接口R1(config)#int s0/0/0.3 point-to-point创建点到点子接口R1(config-subif)#frame-relay interface-dlci 104在点到点子接口上配置DLCI第九章 ACL命令汇总命令作用R1#show ip access-lists查看所定义的IP访问控制列表R1#clear access-list counters将访问控制列表计数器清零R1(config)#access-list <1-199> permit / deny定义ACLR1(config-if)#ip access-group在接口下应用ACLR1(config-line)#access-class <1-199> in / out在vty下应用ACLR1(config)#ip access-list standard / extended定义命名的ACLR1(config)#time-range time定义时间范围R1(config)#username username password password建立本地数据库R1(config-line)#autocommand定义自动执行的命令第十章 DHCP命令汇总命令作用R1#show ip dhcp pool查看DHCP地址池的信息R1#show ip dhcp binding查看DHCP的地址绑定情况R1#show ip dhcp database查看DHCP数据库R1#show ip interface查看接口信息R1#debug ip dhcp server events动态查看DHCP服务器的事件R1(config)#service dhcp开启DHCP服务R1(config)#no ip dhcp conflict logging关闭DHCP冲突日志R1(config)#ip dhcp pool配置DHCP分配的地址池R1(dhcp-config)#network DHCP服务器要分配的网络的掩码R1(dhcp-config)#default-router默认网关R1(dhcp-config)#domain-name域名R1(dhcp-config)#netbios-name-server WINS服务器R1(dhcp-config)#dns-server域名服务器R1(dhcp-config)#option 150 ip FTP服务器R1(dhcp-config)#lease配置租期R1(dhcp-config)#ip dhcp excluded-address排除地址段R1(config-if)#ip helper-address配置DHCP中继的地址第十一章 NAT命令汇总命令作用R1#clear ip nat translation *清除动态NAT表R1#show ip nat translation查看NAT表R1#show ip nat statistics查看NAT转换的统计信息R1#debug ip nat动态查看NAT转换过程R1(config)#ip nat inside source static配置静态NATR1(config-if)#ip nat inside配置NAT内部接口R1(config-if)#ip nat outside配置NAT外部接口R1(config)#ip nat pool配置动态NAT地址池R1(config)#ip nat inside source list access-list-number pool name配置动态NATR1(config)#ip nat inside source list access-list-numbe r pool name overload配置PAT第十二章 交换机基本配置命令汇总命令作用S1(config-if)#duples {full|half|auto}配置以太口的双工属性S1(config-if)#speed {10|100|1000|auto}配置以太口的速率S1(config)#ip default-gateway 172.16.0.254配置默认网关S1(config-if)#switch mode access把端口以为访问模式S1(config-if)#switch port-security打开交换机的端口安全功能S1(config-if)#switch port-security maximum 1该端口下的MAC条目最大数量为1S1(config-if)#switch port-security violation配置交换机端口安全S1(config-if)#switch port-security mac-address MAC地址允许指定MAC地址的设备接入本接口S1#show mac-address-table显示MAC地址表S1(config-if)#mac-address XXXX.XXXX.XXXX改变接口的MAC地址rename flash;config.text flash;config.old将FLASH中的文件改名copy xmodem; flash;c2950-i6q412-mz.121-22.EA5a.bin通过Xmodem模式把文件复制到FLASH中boot重启交换机第十三章 VLAN、Trunk和VTP命令汇总命令作用S1#vlan database进入到VLAN Database配置模式S1(vlan)#vlan 2 name VLAN2创建VLAN 2S1(config-if)#switch access vlan 2把端口划分到VLAN 2中S1(config)#interface range f0/2 - 3批量配置接口的属性S1#show vlan查看VLAN的信息S1(config-if)#switchport trunk encanpsulation配置Trunk链路的封装类型S1(config-if)#switch mode trunk把接口配置为TrunkS1#show interface f0/13 trunk查看交换机端口的Trunk状态S1(config-if)#switchport nonegotiate Trunk链路上不发送Trunk协商包S1(config)#vtp mode server配置交换机为VTP serverS1(config)#vtp domain NAME配置VTP域名S1(config)#vtp password cisco配置VTP的密码S1(config)#vtp mode client配置交换机为VTP clientS3(vlan)#vtp transparent配置交换机为VTP transparentS1#show vtp status显示VTP的状态S1(config)#vtp pruning启用VTP修剪S1(config)#vtp version 2VTP版本为 2S1(config)#interface port-channel 1创建以太通道S1(config-if)#channel-group 1 mode on把接口加入到以太通道中,并指明以太通道模式S1(config)#port-channel load-balance dst-mac配置EtherChannel的负载平衡方式S1#show etherchannel summary查看EtherChannel的简单信息第十四章 STP命令汇总命令作用S1#show spanning-tree查看STP树信息S1(config)#spanning-tree vlan 1 priority 4096配置VLAN1的桥优先级S1(config)#spanning-tree portfast配置为Portfast,当有设备接入时立即进入转发状态S1(config)#spanning-tree uplinkfast配置Uplinkfast特性S1(config)#spanning-tree backbonefast配置Backbonefast特性S1(config)#spanning-tree mode rapid-pvst把STP的运行模式设为RSTP+PVSTS1(config-if)#spanning-tree link-type point-to-point把接口的链路类型改为点对点S1(config)#spanning-tree mode mst把生成树的模式改为MSTS1(config)#spanning-tree mst configuration进入MST的配置模式S1(config-mst)#name TEST-MST命名MST的名字S1(config-mst)#revision 1配置MST的revision号S1(config-mst)#instance 1 vlan 1-2把VLAN 1和VLAN 2的生成树映射到实例1S1(config-if)##spanning-tree guard root在接口下配置Root Guard特性S1(config-if)#spanning-tree bpduguard enable在接口上配置Bpduguard特性第十五章 VLAN间路由命令汇总命令作用S1(config)#int g0/0.1创建子接口S1(config-subif)#encap dot1q 1 native子接口承载哪个VLAN的流量以及封装类型S1(config)#ip routing打开路由功能S1(config-if)#no switchport接口不作为交换机接口S1(config)#ip cef开启CEF功能。

cisco命令大集合

cisco命令大集合

CISCO 技术大集合命令状态1. router>路由器处于用户命令状态,这时用户可以看路由器的连接状态,访问其它网络和主机,但不能看到和更改路由器的设置内容。

2. router#在router>提示符下键入enable,路由器进入特权命令状态router#,这时不但可以执行所有的用户命令,还可以看到和更改路由器的设置内容。

3. router(config)#在router#提示符下键入configure terminal,出现提示符router(config)#,此时路由器处于全局设置状态,这时可以设置路由器的全局参数。

4. router(config-if)#; router(config-line)#; router(config-router)#;…路由器处于局部设置状态,这时可以设置路由器某个局部的参数。

5. >路由器处于RXBOOT状态,在开机后60秒内按ctrl-break可进入此状态,这时路由器不能完成正常的功能,只能进行软件升级和手工引导。

6. 设置对话状态这是一台新路由器开机时自动进入的状态,在特权命令状态使用SETUP命令也可进入此状态,这时可通过对话方式对路由器进行设置。

返回目录三、设置对话过程1. 显示提示信息2. 全局参数的设置3. 接口参数的设置4. 显示结果利用设置对话过程可以避免手工输入命令的烦琐,但它还不能完全代替手工设置,一些特殊的设置还必须通过手工输入的方式完成。

进入设置对话过程后,路由器首先会显示一些提示信息:--- System Configuration Dialog ---At any point you may enter a question mark '?' for help.Use ctrl-c to abort configuration dialog at any prompt.Default settings are in square brackets '[]'.这是告诉你在设置对话过程中的任何地方都可以键入“?”得到系统的帮助,按ctrl-c可以退出设置过程,缺省设置将显示在‘[]’中。

CISCO命令总汇

CISCO命令总汇

交换机switch>-------用户模式Switch>enable----Switch#------特权模式特权模式----show 检查交换机的各种状态pingclear 清除各种表象的命令Switch#show mac-address-table---用于检查交换机的MAC地址表项Mac Address Table-------------------------------------------Vlan Mac Address Type Ports---- ----------- -------- -----All 000c.85a1.7b00 STATIC CPU---交换机MACAll cc STATIC CPU---VTPAll cd STATIC CPU---STPAll 0100.0cdd.dddd STATIC CPU---CGMPVTP----VLAN TRUNK PROTOCOLSTP----SPANNING TREE PROTOCOLCGMP---CISCO 组管理协议--------------------------------------------show ip interface brief--检查交换机所有接口的状态接口编号、物理层和数据链路层的信息。

FastEthernet---快速以太网--100MEthernet ------以太网接口--10M--------------------------------------------FastEthernet0/3 unassigned YES unset up up----只有物理层UP,数据链路层UP的接口才能正常使用。

如果物理层UP,数据链路层DOWN,接口松动。

-------------------------------------------show running-config----检查交换机当前运行配置。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Cisco清除配置使用:erase startup-config(删除NVRAM中的内容),然后重启路由器reload;华为清除配置使用:reset saved-configuration,重启路由器reboot;ctrl+b(backward) 光标左移一个字符ctrl+f(foreward) 光标右移一个字符ctrl+a(a是) 光标移到命令开头ctrl+e(end) 光标移到命令末端esc+b (backward) 光标左移一个词esc+f (foreward) 光标右移一个词ctrl+z一次性退出特权模式Router#关于模式:用户模式(user execution mode),特权模式(privilege execution mode),全局配置模式(global configuration mode),以及在全局配置模式下的具体配置模式(如路由接口配置模式,路由子接口配置模式,路由协议配置模式,line配置模式等)模式的转换:连接路由后首先进入的是用户模式,特征是有符号">",用户模式只能查找路由的配置和状态,不能配置路由,需要配置路由必须进入特权模式,进入特权模式的命令是:enable 若有密码,需要正确密码才能进入,进入特权模式,其特征是有符号"#".从特权模式进入路由全局配置模式命令是:configure terminal从全局配置模式进入各个具体配置模式的命令如下:特权模式--->路由接口配置模式interface serial??(串口)interface ethernet??(以太网口)特权模式--->路由子接口配置模式subinterface特权模式--->路由协议配置模式route rip特权模式--->line配置模式line vty ? ?以下是各个模式下的命令以及用法:用户模式:Router>show ping telnet connect的用法和特权模式一样特权模式:Router#show users 查看连接到路由器的所有用户show hosts 查看ip和名字的映射表show arp 查看ip地址解释show protocol 查看路由器的协议show version 查看ISO的版本,内存show flash 查看flash使用状况show clock 查看路由器的时间show history 查看最近输入的十个命令show ip interface brief 查看接口的ip设置和状态show interfaces 查看路由器所有端口的状态show interfaces 具体端口查看路由器特定端口的状态show running-config 查看在RAM中的配置文件show startup-config 查看在NVRAM中的配置文件show cdp 查看cdp的信息show cdp entry ??(router) 查看特定的邻近连接的路由器show cdp neighbors 查看所有邻近连接的路由器show cdp neighbors detail 查看所有邻近连接的路由器详细信息show cdp traffic 查看cdp数据包的信息show cdp ??(端口号) 查看特定端口的cdp信息show session 远程登陆下查看原路由器的状态clear cdp counters 清除CDP计数器clear cdp table 清除CDP信息copy running-config startup-config 把在RAM中的配置文件复制到NVRAM中copy startup-config running-config 把在NVRAM中的配置文件复制到RAM中copy tftp running-config 把tftp服务器的配置文件传到RAM中copy running-config tftp 把RAM中的配置文件传到tftp服务器ping ??(名字或ip) 检查路由器与远端路由器的连通性telnet ??(名字或ip) 远程登陆路由器(需要登陆密码)connect ??(名字或ip) 和telnet一样traceroute ??(名字或ip) 查看经过的路由全局配置模式:Router(config)#hostname (名字) 更改路由名字enable password ?? 修改进入特权模式的password密码enable secret ?? 修改进入特权模式的secret密码clock set hour:miniute:second day month year 修改路由器的时间ip host ??(名字) ??(ip地址) 添加ip与名字的映射service password-encryption 将各种密码加密(secret已经加密)cdp run 打开所有接口的cdpcdp timer 设置cdp的timecdp holdtime 设置cdp的holdtimeend 从全局配置模式退出到用户模式exit 一步一步的退出,即逐层地推出,输入一个exit则推出一层接口配置模式:Router(config-if)#ip address ??(ip地址) 修改接口的ip地址no shutdown 打开接口shutdowm 关闭端口clock rate ?? 设置DCE的同步时间(DTE不需要)cdp enable 打开端口的cdpline配置模式:Router(config-line)#line vty 0 4password ??login 设置最大用户登陆数并且设置登陆密码收录最常用的Cisco命令分类如下:1. switch配置命令(1)模式转换命令用户模式----特权模式,使用命令"enable"特权模式----全局配置模式,使用命令"config t"全局配置模式----接口模式,使用命令"interface+接口类型+接口号" 全局配置模式----线控模式,使用命令"line+接口类型+接口号" 注:用户模式:查看初始化的信息.特权模式:查看所有信息、调试、保存配置信息全局模式:配置所有信息、针对整个路由器或交换机的所有接口接口模式:针对某一个接口的配置线控模式:对路由器进行控制的接口配置(2)配置命令show running config 显示所有的配置show versin 显示版本号和寄存器值shut down 关闭接口no shutdown 打开接口ip add +ip地址配置IP地址secondary+IP地址为接口配置第二个IP地址show interface+接口类型+接口号查看接口管理性show controllers interface 查看接口是否有DCE电缆show history 查看历史记录show terminal 查看终端记录大小hostname+主机名配置路由器或交换机的标识config memory 修改保存在NVRAM中的启动配置exec timeout 0 0 设置控制台会话超时为0service password-encryptin 手工加密所有密码enable password +密码配置明文密码ena sec +密码配置密文密码line vty 0 4/15 进入telnet接口password +密码配置telnet密码line aux 0 进入AUX接口password +密码配置密码line con 0 进入CON接口password +密码配置密码bandwidth+数字配置带宽no ip address 删除已配置的IP地址show startup-config 查看NVRAM中的配置信息,即查看启动配置文件show running-config 查看现行配置文件copy running-config startup-config 将现行配置好的信息保存到启动配置文件里,这样下次路由器启动的时候就是这次配置的结果write 保存信息到NVRAM,即保存到启动配置文件里erase startup-config 清除NVRAM中的配置信息,即清除启动配置文件show ip interface brief 查看接口的谪要信息banner motd # +信息+ # 配置路由器或交换机的描素信息description+信息配置接口听描素信息vlan database 进入VLAN数据库模式vlan +vlan号+ 名称创建VLANswitchport access vlan +vlan号为VLAN为配接口interface vlan +vlan号进入VLAN接口模式ip add +ip地址为VLAN配置管理IP地址vtp+service/tracsparent/client 配置SW的VTP工作模式vtp +domain+域名配置SW的VTP域名vtp +password +密码配置SW的密码switchport mode trunk 启用中继no vlan +vlan号删除VLANshow spamming-tree vlan +vlan号查看VLA怕生成树议2. 路由器配置命令ip route+非直连网段+子网掩码+下一跳地址配置静态/默认路由show ip route 查看路由表show protocols 显示出所有的被动路由协议和接口上哪些协议被设置show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用的定时器等信息router rip 激活RIP协议network +直连网段发布直连网段interface lookback 0 激活逻辑接口passive-interface +接口类型+接口号配置接口为被动模式debug ip +协议动态查看路由更新信息undebug all 关闭所有DEBUG信息router eigrp +as号激活EIGRP路由协议network +网段+子网掩码发布直连网段show ip eigrp neighbors 查看邻居表show ip eigrp topology 查看拓扑表show ip eigrp traffic 查看发送包数量router ospf +process-ID 激活OSPF协议network+直连网段+area+区域号发布直连网段show ip ospf 显示OSPF的进程号和ROUTER-IDencapsulation+封装格式更改封装格式no ip admain-lookup 关闭路由器的域名查找ip routing 在三层交换机上启用路由功能show user 查看SW的在线用户clear line +线路号清除线路3. 三层交换机配置命令配置一组二层端口configure terminal 进入配置状态nterface range {port-range} 进入组配置状态配置三层端口configure terminal 进入配置状态interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} | {port-channel port-channel-number} 进入端口配置状态no switchport 把物理端口变成三层口ip address ip_address subnet_mask 配置IP地址和掩码no shutdown 激活端口例:Switch(config)# interface gigabitethernet0/2Switch(config-if)# no switchportSwitch(config-if)# ip address 192.20.135.21 255.255.255.0Switch(config-if)# no shutdown配置VLANconfigure terminal 进入配置状态vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改。

相关文档
最新文档