思科交换机-常用命令及配置

合集下载

思科路由器交换机常用配置命令

思科路由器交换机常用配置命令

1、进入SETUP模式Router#setup2、时间设置router#clock set hh:mm:ss date moth year3、router>show historyRouter>terminal history size lines4、router#show version5、router#show running-config6、router#show starup-config7、router(config)#hostname name主机命名8、router(config)#banner motd # message #开机时的固定显示信息9、router(config)#enable password password 特权模式明文密码10、router(config)#no enable password11、router(config)#enable secret password 特权模式加密密码12、router(config)#no enable secret13、router(config)#service password-encryption特权模式把明文密码加密密码,但没enable secret安全可以反解14、router(config)#line console控制台密码15、router(config-line)#login16、router(config-line)#password password17、router(config-line)#exec-timeout mm ss 禁止控制台会话自动退出18、router(config-line)#logging synchronous重显被打乱的控制台输入router(config)#no ip domain-lookup 禁止域名解析19、router(config)#line vty 0 4虚拟终端密码20、router(config-line)#login21、router(config-line)#password password22、router(config)#interface type number(slot/port)端口设置23、router(config-if)#ip address ip summast24、router(config-if)#clock rate 64000(时钟频率单位为bps,只在DCE端设置)25、router(config-if)#bandwith 64(带宽设置,单位为KB)26、router(config-if)#no shutdown(shutdown)27、router(config-if )#media-type type(10base) 为以太网端口选择适当的介质类型28、router(config-if )#ctrl+z保存退出到特权模式29、router#30、router>用户模式enable进入router#特权模式config terminal进入router(config)#全局配置模式31、Interface Router(config-if)#端口设置Subinterface Router(config-subif)# 子端口设置Controller Router(config-controller)# 控制口设置Line Router(config-line)# 虚拟口设置Router Router(config-router)# 路由设置IPX router Router(config-ipx-router)#IPX路由设置32、router#show interface33、router#show interface Ethernet 034、router#show interface serial 035、router#show running-config36、router#show starup-config37、router#show flash38、router#show controller39、router#show controller interface type40、router#show running-configrouter#copy running-config starup-configrouter#copy running-config tftprouter#copy starup-config tftprouter#copy flash tftprouter#copy tftp star-configrouter#copy tftp flash端口状态Serial1 is up, line protocol is up正常工作Serial1 is up, line protocol is down连接问题Serial1 is down, line protocol is down端口问题Serial1 is administratively down, line protocol is down人为关闭配置寄存器的值1、关闭路由器的电源重新启动按住ctrl+break键入进2、>3、>o/r 0x2142(跳过nvarm启动恢复密码)4、>I5、当系统提示是否进入setup模式时,按N6、router>7、router>enable8、router#9、进入修改后(包括密码、寄存器的值:0x2100为rom monitor启动、0x2101为setup 模式启动、0x2102为10、router#copy running-config starup-config11、router#reload12、也可以在router#setup进入setup模式静态路由协议设置router(config)#ip route network submask(要到达的网络号掩码)ip address(下一跳或出口ip地址)router(config)#ip route 0.0.0.0 s0(出口端口或下一跳IP地址)rip设置router(config)#router riprouter(config-router)#network network-numberrouter#show ip protocol查看RIP信息router#show ip route 查看路由表router#debug ip rip查看RIP更新信息router(config-router)#passive-interface e0(阻止发出作息)router(config-router)#ip rip receive version 1 2接收1、2RIP版本信息igrp设置router(config)#router igrp as numberrouter(config-router)#network network numberrouter#show ip route查看路由表router#debug ip igrp events查看IGRP路由更新大概信息router#debug ip igrp transaction查看IGRP路由更新详细信息Router(config-router)#variance multiplier 控制IGRP load balancingRouter(config-router)#traffic-share {balanced | min}控制load-balanced traffic 的分布eigrp设置router(config)#router eigrp as numberrouter(config-router)#network network numberrouter(config)#no auto-summry 关闭自动汇总router(config)# auto-summry 打开自动汇总(默认是打开的)router#show ip route eigrp 显示当前的路由表里的EIGRP条目router#show ip protocol 显示活动的路由协议进程的参数和当前的状态router#show ip eigrp neighbors 显示被EIGRP发现的邻居router#show ip eigrp traffic 显示发出和收到的IP EIGRP 包的数量router#show ip eigrp topology 显示IP EIGRP的拓扑表Router#debug ip eigrpospf设置1. Router(config)#router ospf process-idRouter(config-router)#network address(可以是网络号也可以是Ip地址mask(通配掩码)area area-idRouter(config-if)# ip ospf priority numbe 配置OSPF的优先级Router#show ip protocols 验证OSPF的配置Router#show ip route 显示路由器学到的所有路由Router#show ip ospf interface type number 显示area-ID 和邻接信息Router#show ip ospf neighbor 基于每接口显示OSPF邻居信息Router#debug ip ospf eventsRouter#debug ip ospf packet2. Router(config)# interface loopback number(lookback回路配置)Router(config-if)# ip address ip-address subnet-maskRouter(config-if)# ip ospf cost cost-numbe 修改OSPF 的Cost数值Router(config-if)# ip ospf authentication-key key 配置明文口令Router(config-if)# ip ospf messge-digest-key keyid md5 key 配置MD5口令(keyid和key必须配对一致,两邻居才可以通信)Router(config-route)# area area-id authentication [message-digest] message-digest为可选项,使用后路由器只传送口令消息的摘要(或散列)配置OSPF 区域的验证:3. Router(config-if)# ip ospf hello-interval seconds 配置hello间隔:Router(config-if)# ip ospf dead-interval seconds配置down机判断间隔访问列表1.标准访问列表(standard access lists):只使用源IP地址来做过滤决定Router(config)#access-list 10 deny 172.16.40.0 0.0.0.255Router(config)#access-list 10 permit anyRouter(config)#int e1Router(config-if)#ip access-group 10 out使用IP标准ACL来控制VTY线路的访问.Router(config)#access-list 50 permit 172.16.10.3Router(config)#line vty 0 4Router(config-line)#access-class 50 in删除IP标准ACLRouter(config-line)#no ip access-class 50 inRouter(config)#no access-list 502.扩展访问列表(extended access lists):它比较源IP地址和目标IP地址,层3的协议字段,层4端口号来做过滤决定Router(config)#access-list 110 deny tcp any host 172.16.30.5 eq 21Router(config)#access-list 110 deny tcp any host 172.16.30.5 eq 23Router(config)#access-list 110 permit ip any anyRouter(config)#int e1Router(config-if)#ip access-group 110 out3.虚拟通道访问router(config)#access-list 12 permit 192.89.55.0 0.0.0.255router(config)#line vty 0 4outer(config-line)#access-class 12 in3.show ip interface:只显示IP访问列表信息4.show ip interface:显示所有接口的信息和配置的ACL信息5.show ip interface [接口号]:显示具体某个接口的信息和配置的ACL信息6.show running-config:显示DRAM信息和ACL信息,以及接口对ACL的应用信息.交换机配置交换机上设置登陆口令Switch(config)# enable password level level passwordSwitch(config)# no enable password level level passwordhostname1900/2900(config)#hostname hostnameIP Address1900(config)#ip address {ip address} {mask}1900(config)#ip address 10.5.5.11 255.255.255.02950(config#interface vlan 12950(config-if)#ip address {ip_address} {mask}2950(config)#interface vlan 12950(config-if)#ip address 10.5.5.11 255.255.255.0 default gateway1900/2950(config)#ip default-gateway {ip address}1900/2950(config)#ip default-gateway 172.20.137.1查看交换机的IP地址1900#show ipIP address: 10.5.5.11Subnet mask: 255.255.255.0Default gateway: 10.5.5.3Management VLAN: 12950#show interface vlan 1Vlan1 is up, line protocol is upHardware is Cat5k Virtual Ethernet, address is 0010.f6a9.9800 (bia0010.f6a9.9800)Internet address is 172.16.80.79/24Broadcast address is 255.255.255.255设置双工选项1900(config)#interface e0/11900(config-if)#duplex {auto | full |full-flow-control | half}2950(config)#interface fe0/12950(config-if)#duplex {auto | full | half}设置端口速度:switch(config-if)# speed {10|100|auto}查勘双工选项Switch#show interfaces fastethernet0/3查看MAC地址表1900/2950#show mac-address-table配置永久MAC地址1900(config)#mac-address-table permanent {mac-address type module/port} 1900(config)#mac-address-table permanent 2222.2222.2222 ethernet 0/3 1900#show mac-address-table2950(config)#mac-address-table static mac_addr {vlan vlan_id} [interface int1 [int2 ... int15]]配置受限静态MAC地址1900(config)#mac-address-table restricted static {mac-address type module/port src-if-list}1900(config)#mac-address-table restricted static 1111.1111.1111 e0/4 e0/11900#show mac-address-table2950(config)#mac-address-table secure mac-addr interface [vlan vlan-id]2950(config)#mac-address-table secure 0003.3333.3333 fa 0/1 vlan 12950#show mac-address-table配置端口安全性1900(config-if)#port secure max-mac-count count1900(config)#interface e0/41900(config-if)#port secure1900(config-if)#port secure max-mac-count 11900(config)#address-violation {suspend | disable | ignore1900# show mac-address-table security2950(config-if)#port security max-mac-count count2950(config)#interface fa0/12950(config-if)#port security2950(config-if)#port security max-mac-count 102950(config-if)#port security action {shutdown | trap}2950#show mac-address-table secure2950#show port-security管理配置文件1900#copy nvram tftp://host/dst_file1900#copy tftp://host/src_file nvram1950#copy nvram tftp://10.1.1.1/wgswd.cfg2950#copy startup-config tftp://host/dst_file清除NVRAM1900#delete nvram2950#erase startup-configvlan配置1900 VLAN建立1900下,使用vlan [vlan#] name [name] [vlan#]命令, 如下: >en#config t(config)#hostname 19001900(config)#vlan 2 name sales1900(config)#vlan 3 name marketing1900(config)#vlan 4 name mis1900(config)#exit端口分配1900(config)#int e0/21900(config-if)#vlan-membership static 21900(config)#int e0/41900(config-if)#vlan-membership static 31900(config)#int e0/51900(config-if)#vlan-membership static 41900(config-if)#exit1900(config)#exitVLAN验证1900#sh vlan2900 VLAN建立在2950下创建VLAN,在特权模式下使用vlan database命令2950#vlan database2950(vlan)#vlan 2 name MarketingVLAN 2 modified:Name: Marketing2950(vlan)#vlan 3 name AccountingVLAN 3 added:Name: Accounting2950(vlan)#applyAPPLY complete2950(vlan)#Ctrl+C2950#端口分配2950下的端口配置,使用switchport access vlan [vlan#]命令, 2950(config-if)#int f0/22950(config-if)#switchport access vlan 22950(config-if)#int f0/32950(config-if)#switchport access vlan 32950(config-if)#int f0/42950(config-if)#switchport access vlan 42950(config-if)#exit2950(config)#exit验证配置信息,如下:2950#sh vlan或2950#sh vlan brieftrunk配置1900trunk配置1900(config)#int f0/261900(config-if)#trunk on2950下在接口配置模式,使用switchport命令,如下:2950(config)#int f0/122950(config-if)#switchport mode trunk2950(config-if)# switchport trunk encapsulation {isl|dot1q} 2950(config-if)#^Z将某VLAN从中继中删除2950(config-if)# switchport trunk allowed vlan remove vlan-list添加某个VLAN到中继线路2950(config-if)# switchport trunk allowed vlan add vlan-list Configuring Inter-VLAN Routing给连接1900的trunk端口配置,使用encapsulation isl [vlan#]命令,如下: 2600Router(config)#int f0/0.12600Router(config-subif)#encapsulation isl [vlan#]2600Router(config-subif)#ip add ip add submask给连接2950的这样配置,如下:2600Router(config)#int f0/0.12600Router(config-subif)#encapsulation dot1q [vlan#]2600Router(config-subif)#ip add ip add submaskVTP配置1900(config)#vtp server1900(config)#vtp domain noco1900(config)#vtp password noko在特权模式下使用show vtp命令验证,如下:1900#sh vtpVTP version: 1Configuration revision: 0Maximum VLANs supported locally: 1005Number of existing VLANs: 5VTP domain name: nocoVTP password: nokoVTP operating mode: Server2950如下:2950(config)#vtp mode server2950(config)#vtp domain noco验证信息,如下:2950#sh vtp ?counters VTP statisticsstatus VTP domain status2950#sh vtp statusNAT配置配置静态转换Router(config)#ip nat inside source static local-ip global-ipRouter(config-if)#ip nat insideRouter(config-if)#ip nat outside配置动态地址转换Router(config)#ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length}Router(config)#access-list access-list-number permit source [source-wildcard]Router(config)#ip nat inside source listaccess-list-number pool name配置OverloadingRouter(config)#access-list access-list-number permitsource source-wildcardRouter(config)#ip nat inside source listaccess-list-number interface interface overload清除NAT Translation TableRouter#clear ip nat translation * 清除所有的动态地址转换条目Router#clear ip nat translation inside global-iplocal-ip [outside local-ip global-ip] 清除一个简单的动态地址转换条目(内、外)Router#clear ip nat translation outsidelocal-ip global-ip清除一个简单的动态地址转换(外)Router#clear ip nat translation protocol inside global-ipglobal-port local-ip local-port [outside local-iplocal-port global-ip global-port] 清除一个扩展动态地址转换条目Show命令输出信息Router#show ip nat translations1.在基于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)# de脚本ion de脚本ion-string基于CLI的交换机的端口描述:switch(enable)set port name module/number de脚本ion-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-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-rangemode{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-ratepkts-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-name cv21. 为了从一条中继链路上删除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 bridgebridge-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)# de脚本ion de脚本ion-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 multipointrouter(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-number ()41. 配置默认路由: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高速缓存区的内容。

思科交换机常用的一些命令

思科交换机常用的一些命令

switch(config-line)#login 允许登录
switch(config-line)#password xx
基本接口配置
switch(config)#interface f0/1 进入f0/1接口
switch(config-if)#duplex full 配置全双工模式
switch(config)#enable password xxa 设置特权非密口令
使用Telnet远程式管理
switch(config)#interface vlan 1 进入vlan 1
switch(config-if)#ip address 设置IP地址
switch(config-if)#ip default-gateway 设置默认网关
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 hello-time 配置交换机hello时间(基于vlan)
switch(config)#spanning-tree vlan forward-time 修改转发延迟计时器(基于vlan)
switch(config)#spanning-tree vlan max-time 修改最大老化时间(基于vlan)
switch(config)#line vty 0 4 进入虚拟终端

思科路由器交换机配置命令

思科路由器交换机配置命令

思科路由器交换机配置命令1思科路由器常用配置命令一览表: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-script 定义一个调制解调器对话文本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参数2思科交换机常用配置命令switch> 用户模式1:进入特权模式 enableswitch> enableswitch#2:进入全局配置模式 configure terminalswitch> enableswitch#c onfigure terminalswitch(conf)#3:交换机命名hostname aptech2950 以aptech2950为例switch> enableswitch#c onfigure terminalswitch(conf)#hostname aptch-2950aptech2950(conf)#4:配置使能口令 enable password cisco 以cisco为例switch> enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable password cisco5:配置使能密码 enable secret ciscolab 以cicsolab为例switch> enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable secret ciscolab6:设置虚拟局域网vlan 1 interface vlan 1switch> enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface vlan 1aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 配置交换机端口ip和子网掩码aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exitaptech2950(conf)#ip default-gateway 192.168.254 设置网关地址7:进入交换机某一端口interface fastehernet 0/17 以17端口为例switch> enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface fastehernet 0/17aptech2950(conf-if)#8:查看命令 showswitch> enableswitch# show version 察看系统中的所有版本信息show interface vlan 1 查看交换机有关ip 协议的配置信息show running-configure 查看交换机当前起作用的配置信息show interface fastethernet 0/1 察看交换机1接口具体配置和统计信息show mac-address-table 查看mac地址表show mac-address-table aging-time 查看mac地址表自动老化时间9:交换机恢复出厂默认恢复命令switch> enableswitch# erase startup-configureswitch# reload10:双工模式设置switch> enableswitch#c onfigure terminalswitch2950(conf)#hostname aptch-2950aptech2950(conf)# interface fastehernet 0/17 以17端口为例aptech2950(conf-if)#duplex full/half/auto 有full , half, auto 三个可选项11:cdp相关命令switch> enableswitch# show cdp 查看设备的cdp全局配置信息show cdp interface fastethernet 0/17 查看17端口的cdp配置信息show cdp traffic 查看有关cdp包的统计信息show cdp nerghbors 列出与设备相连的cisco设备12:csico2950的密码恢复拔下交换机电源线。

Cisco思科光纤交换机配置说明及常用命令

Cisco思科光纤交换机配置说明及常用命令

Cisco思科光纤交换机配置说明及常⽤命令你还在为不知道Cisco思科光纤交换机配置说明⽽烦恼么?下⾯⼩编为⼤家收集的Cisco思科光纤交换机配置说明教程,希望能帮到⼤家,⼀起来看看吧!Cisco思科光纤交换机配置说明的⽅法1. 初始化信息⾸次设置,必须通过console进⾏连接(需要U⼝转DB9针的接⼝线,专门卖接⼝线的有卖⼤约30元),然后进⾏初始化设计,以后设定IP后可通过LAN进⾏登陆具体步骤:(红⾊字体部分着重注意,需要进⾏设置,⼤部分按照默认设置即可,⽽且设置的部分进⼊管理⼯具软件可以更改)---- System Admin Account Setup ----Enter the password for "admin": passwordConfirm the password for "admin": password--- Basic System Configuration Dialog ---This setup utility will guide you through the basic configuration of the system. Setup configures only enough connectivity for management of the system.Press Enter at any time to skip any dialog. Use ctrl-c at anytime to skip the remaining dialogs.Would you like to enter the basic configuration dialog (yes/no): yCreate another login account (yes/no) [n]:Configure read-only SNMP community string (yes/no) [n]:Configure read-write SNMP community string (yes/no) [n]:Enter the switch name: Pxx-MDS-x (where xx is your pod number and x is the switch number; for example:P01-MDS-1) Continue with Out-of-band (mgmt0) management configuration? (yes/no) [y]:Mgmt0 IPv4 address : <10.0.x.y> (where x is your pod number and y is 5 for MDS-1 and 3 for MDS-2)(客户)0.16Mgmt0 IPv4 netmask : 255.255.255.0Configure the default gateway? (yes/no) [y]:IPv4 address of the default gateway : 10.0.x.254 (where x is your pod number)Configure advanced IP options? (yes/no) [n]:Enable the telnet service? (yes/no) [y]:Enable the ssh service? (yes/no) [n]:Configure the ntp server? (yes/no) [n]:Configure default switchport interface state (shut/noshut) [shut]: (注意⼀下)noshutConfigure default switchport trunk mode (on/off/auto) [on]:Configure default zone policy (permit/deny) [deny]:Enable full zoneset distribution (yes/no) [n]:NOTE:初始设定的配置对新的VSAN起作⽤,即原始VSAN1⽆这些配置解决办法:1 zone default-zone permit VSAN2 新建 NEW VSAN2 将port转移VSAN2⾥⾯。

思科交换机 路由器配置命令大全

思科交换机 路由器配置命令大全

思科Cisco交换机、路由器设置命令交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname <hostname> ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令为 xxxswitch(config)#enable password xxx ;设置特权非密口令为 xxxswitch(config)#line console 0 ;进控制台口(Rs232)初始化switch(config-line)#line vty 0 4 ;进入虚拟终端virtual ttyswitch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xx switch#exit ;返回命令交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config-if)#switchport access vlan 2 ;当前端口1加入VLAN 2switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2;设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置vlan中继switch(config)#vtp domain <name> ;设置发vtp域名switch(config)#vtp password <word>switch(config)#vtp mode serverswitch(config)#vtp mode client交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1 switch(config-if)#ip address <IP> <mask> ;添加远程登录IP switch(config)#ip default-gateway <IP> ;添加默认网关switch#dir flash: ;查看内存交换机显示命令:switch#write ;写入保存switch#show vtpswitch#show run ;查看当前配置信息switch#show vlan ;看VLANswitch#show interface ;显示所有端口信息switch#show int f0/0 ;显示端口0的信息 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^路由器显示命令:router#show run ;显示接口router#show interface ;显示接口router#show ip route ;显示路由router#show cdp nei ;看邻居router#reload ;重新起动设置口令:router>enable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#hostname <hostname> ;设置交换机的主机名router(config)#enable secret xxx ;设置特权加密口令为 xxxrouter(config)#enable password xxx ;设置特权非密口令为 xxxrouter(config)#line console 0 ;进控制台口(Rs232)初始化router(config-line)#line vty 0 4 ;进入虚拟终端virtual ttyrouter(config-line)#login ;允许登录router(config-line)#password xx ;设置登录口令xx router(config)# (Ctrl+z) ;返回特权模式router#exit ;返回命令配置IP地址:router(config)#int s0/0 ;进行串Serail接口router(config-if)#no shutdown ;起动接口router(config-if)#clock rate 64000 ;设置时钟router(config-if)#ip address 10.1.1.1 255.255.0.0 ;设置IP地址和子网掩码router(config-if)#ip add 10.1.1.2 255.255.0.0 second;router(config-if)#int f0/0.1 ;进入子接口router(config-subif.1)#ip address <ip><netmask> ;router(config-subif.1)#encapsulation dot1q <n> ;router(config)#config-register 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导复制操作:router#copy running-config startup-config ;存配置router#copy running-config tftp ;上载router#copy startup-config tftprouter#copy tftp flash: ;特权模式下升级IOSrouter#copy tftp startup-config ;下载配置文件到nvramROM状态:Ctrl+Break ;进入ROM监控状态rommon>confreg 0x2142 ;跳过配置,26 36 45xxrommon>confreg 0x2102 ;使用配置,恢复工作状态rommon>reset ;重新引导,等效于重开机rommon>copy xmodem:<sname> flash:<dname> ;从console升级IOSrommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IPrommon>TFTP_FILE=c2600.bin ;所要下载的文件rommon>tftpdnld ;ROM监控状态下升级IOSrommon>dir flash: ;查看闪存中的内容rommon>boot ;引导IOS静态路由:ip route <ip-address> <subnet-mask> <gateway> 例:router(config)#ip route 10.1.0.0 255.255.0.0 10.2.1.1router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2动态路由:router(config)#ip routing ;启动路由router(config)#router rip ;启动RIP路由协议。

思科交换机配置命令

思科交换机配置命令

Cmd1. 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 号或旧的来进行修改。

思科命令大全(完整版)

思科命令大全(完整版)

思科交换机命令大全1.设置主机名/系统名IOS:switch(config)# hostname "hostname"CLI:switch(enable) set system name name-string2.设置登录口令IOS:switch(config)# enable password level 1 passwordCLI: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-addressCLI:switch(enable) set interface sc0 ip-address netmask broadcast-address switch(enable) set interface sc0 vlanswitch(enable) set ip route default gateway4.启用和浏览CDP信息IOS:switch(config-if)# cdp enableswitch(config-if)# no cdp enableCLI:switch(enable) set cdp {enable|disable} module/port5.查看Cisco邻接设备的CDP通告IOS:switch# show cdp interface [type modle/port]switch# show cdp neighbors [type module/port] [detail]CLI:switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 6.端口描述 IOS:switch(config-if)#description escription-stringCLI:switch(enable)set port name module/number description-string7.设置端口速度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}8.设置以太网的链路模式IOS:switch(config-if)# duplex {auto|full|half}CLI:switch(enable) set port duplex module/number {full|half}9.配置静态VLANIOS: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)# endCLI:switch(enable) set vlan vlan-num [name name]switch(enable) set vlan vlan-num mod-num/port-list10.配置VLAN中继线IOS: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:switch(enable)set trunk module/port [on|off|desirable|auto|nonegotiate] Vlan-range [isl|dotlq|dotl0|lane|negotiate]11.配置VTP管理域IOS:switch# vlan databaseswitch(vlan)# vtp domain domain-nameCLI:switch(enable) set vtp [domain domain-name]12.配置VTP 模式IOS:switch# vlan databaseswitch(vlan)# vtp domain domain-nameswitch(vlan)# vtp {sever|cilent|transparent}switch(vlan)# vtp password passwordCLI:switch(enable) set vtp [domain domain-name][mode{ sever|cilent|transparent }][password password]13.配置VTP版本IOS:switch# vlan databaseswitch(vlan)# vtp v2-modeCLI:switch(enable) set vtp v2 enable14.启动VTP剪裁IOS:switch# vlan databaseswitch(vlan)# vtp pruningCLI:switch(enable) set vtp pruning enable15.配置以太信道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} 16.调整根路径成本IOS:switch(config-if)#spanning-tree [vlan vlan-list] cost costCLI:switch(enable)set spantree portcost moudle/port costswitch(enable)set spantree portvlancost moudle/port [cost cost][vlan-list] 17.调整端口IDIOS:switch(config-if)#spanning-tree[vlan vlan-list]port-priority port-priority CLI:switch(enable)set spantree portpri {mldule/port}priorityswitch(enable)set spantree portvlanpri {module/port}priority [vlans]18.修改STP时钟IOS:switch(config)# spanning-tree [vlan vlan-list] hello-time secondsswitch(config)#spanning-tree [vlan vlan-list] forward-time secondsswitch(config)#spanning-tree [vlan vlan-list] max-age seconds CLI:switch(enable) set spantree hello interval[vlan]switch(enable) set spantree fwddelay delay [vlan]switch(enable) set spantree maxage agingtiame[vlan]19.启用或禁用Port Fast 特征IOS:switch(config-if)#spanning-tree portfastCLI:switch(enable)set spantree portfast {module/port}{enable|disable}20.启用或禁用UplinkFast 特征IOS:switch(config)#spanning-tree uplinkfast [max-update-rate pkts-per-second]CLI:switch(enable)set spantree uplinkfast {enable|disable}[rate update-rate] [all-protocolsoff|on] 为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个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 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-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高速缓存区的内容。

思科交换机路由基本配置命令

思科交换机路由基本配置命令

思科交换机路由基本配置命令常用命令1.配置接口:interface {interface_type} {interface_number}2.配置IP地址:ip address {IP_address} {subnet_mask}3.配置默认网关:ip default-gateway {default_gateway_IP}4.开启接口:no shutdown5.配置路由协议:router {routing_protocol}6.配置路由器ID:router-id {router_ID}7.配置路由信息:network {network_address} {subnet_mask}8.配置静态路由:ip route {destination_network} {subnet_mask}{next-hop_IP}9.配置动态路由:router {routing_protocol} {network_address}10.保存配置:copy running-config startup-config注意:上述命令仅作为参考,具体配置应根据实际环境和设备型号进行调整。

下面是一些基本的 Cisco 交换机路由配置命令:1.配置 hostname: hostname <name>2.配置 IP 地址: interface <interface> 后进入接口模式,再输入 ipaddress <ip address> <subnet mask>3.配置默认路由: ip route 0.0.0.0 0.0.0.0 <next hop IP>4.启用路由协议: router <protocol> (例如: router rip)5.配置路由连接: network <network address> (例如: network192.168.1.0)6.查看路由表: show ip routeCisco 交换机路由配置步骤1.进入配置模式:configure terminal2.配置 IP 地址和子网掩码:interface [interface-name] ; ip address[ip-address] [subnet-mask]3.配置默认路由:ip route 0.0.0.0 0.0.0.0 [next-hop-IP-address]4.启用路由协议:router [protocol-name] (如:router ospf)5.配置路由协议参数: [protocol-name] [process-id] (如:ospf 1)6.配置路由连接:network [network-address] [wildcard-mask] area[area-id] (如:network 192.168.1.0 0.0.0.255 area 0)7.保存配置:copy running-config startup-config8.退出配置模式:exit。

思科华为全系列交换机路由器常用命令

思科华为全系列交换机路由器常用命令

思科华为全系列交换机路由器常用命令交换机/路由器配置综合复习交换机/路由器常用命令汇总本课内容交换机常用命令2交换机常用命令交换机常用命令31.交换机常用命令·>Enable进入特权模式·#E某it返回上一级操作模式·#End返回到特权模式·#writememory或copyrunning-configtartup-config保存配置文件·#delflah:config.te某t删除配置文件(交换机及1700系列路由器)·#delflah:vlan.dat删除Vlan配置信息(交换机)·(config)#hotnamewitchA配置设备名称4为witchA1.交换机常用命令·(config)#enableecretlevel10tar配置远程登陆密码为tar·(config)#enableecretlevel150tar配置特权密码为tar·Level1为普通用户级别,可选为1~15,15为最高权限级别;0表示密码不加密·(config)#enableerviceweb-erver开启交换机WEB管理功能·Service可选以下:web-erver(WEB管理)、telnet-erver(远程登陆)等51.交换机常用命令查看信息·#howrunning-config查看当前生效的配置信息·#howinterfacefatethernet0/3查看F0/3端口信息·#howinterfaceerial1/2查看S1/2端口信息·#howinterface查看所有端口信息·#howipinterfacebrief以简洁方式汇总查看所有端口信息·#howipinterface查看所有端口信息·#howverion查看版本信息61.交换机常用命令查看信息·#howmac-addre-table查看交换机当前MAC地址表信息·#howrunning-config查看当前生效的配置信息·#howvlan查看所有VLAN信息·#howvlanid10查看某一VLAN(如VLAN10)的信息·#howinterfacefatethernet0/1witchport查看某一端口模式(如F0/1)·#howaggregateport1ummary查看聚合端7口AG1的信息1.交换机常用命令查看信息·#howpanning-tree查看生成树配置信息·#howpanning-treeinterfacefatethernet0/1查看该端口的生成树状态·#howport-ecurity查看交换机的端口安全配置信息·#howport-ecurityaddre查看地址安全绑定配置信息·#howipacce-litlitname查看名为litname的列表的配置信息8·#howacce-lit1.交换机常用命令端口的基本配置·(config)#Interfacefatethernet0/3进入F0/3的端口配置模式·(config)#interfacerangefa0/1-2,0/5,0/7-9进入F0/1、F0/2、F0/5、F0/7、F0/8、F0/9的端口配置模式·(config-if)#peed10配置端口速率为10M,可选10,100,auto91.交换机常用命令端口的基本配置·(config-if)#duple某full配置端口为全双工模式,可选full(全双工),half(半双式),auto(自适应)·(config-if)#nohutdown开启该端口·(config-if)#witchportaccevlan10将该端口划入VLAN10中,用于VLAN·(config-if)#witchportmodetrunk将该端口设为trunk模式,可选模式为acce,trunk·(config-if)#port-group1将该端口划入聚合端口AG1中,用于聚合端口101.交换机常用命令聚合端口的创建·(config)#interfaceaggregateport1创建聚合接口AG1·(config-if)#witchportmodetrunk配置并保证AG1为trunk模式·(config)#intf0/23-24·(config-if-range)#port-group1将端口(端口组)划入聚合端口AG1中111.交换机常用命令生成树·(config)#panning-tree开启生成树协议·(config)#panning-treemodetp指定生成树类型为tp可选模式tp,rtp,mtp·(config)#panning-treepriority4096设置交换机的优先级为4096,优先级值小为高。

思科交换机路由器命令大全

思科交换机路由器命令大全

思科交换机路由器命令大全思科交换机和路由器命令大全本文档为思科交换机和路由器命令的最新最全范本,供参考使用。

以下是详细的命令列表,包括每个命令的说明和用法。

一、接口配置命令1、ip address:设置接口的IP地质示例:ip address 192.168.1.1 255.255.255:02、no shutdown:启用接口示例:no shutdown3、duplex:设置接口的双工模式示例:duplex auto4、speed:设置接口的速度示例:speed 1005、exit:退出接口配置模式示例:exit二、VLAN命令1、vlan database:进入VLAN数据库模式示例:vlan database2、vlan id name:创建VLAN并设置名称示例:vlan 10 name VLAN-103、vlan id:删除VLAN示例:no vlan 104、show vlan:显示VLAN信息示例:show vlan5、exit:退出VLAN数据库模式示例:exit三、路由命令1、ip route:设置静态路由示例:ip route 192.168.2:0 255.255.255:0 192.168.1.22、router rip:启用RIP路由协议示例:router rip3、network:将网络添加到RIP路由表中示例:network 10:0:0:04、redistribute:将静态路由或其他路由协议添加到RIP路由表中示例:redistribute static5、exit:退出路由配置模式示例:exit四、ACL命令1、access-list:创建标准或扩展ACL示例:access-list 10 permit 192.168.1:0 0:0:0.2552、ip access-group:应用ACL到接口示例:ip access-group 10 in3、show access-lists:显示ACL信息示例:show access-lists4、exit:退出ACL配置模式示例:exit五、SNMP命令1、snmp-server community:设置SNMP团体字符串示例:snmp-server community public RO2、snmp-server enable traps:启用SNMP陷阱示例:snmp-server enable traps3、snmp-server host:配置SNMP陷阱接收主机示例:snmp-server host 192.168.1.1004、exit:退出SNMP配置模式示例:exit六、SSH命令1、ip ssh version:设置SSH协议版本示例:ip ssh version 22、crypto key generate rsa:RSA密钥对示例:crypto key generate rsa3、username:创建新的本地用户示例:username admin privilege 15 password password1234、exit:退出SSH配置模式示例:exit七、其他命令1、show running-config:显示当前配置示例:show running-config2、copy running-config startup-config:将当前配置保存到启动配置中示例:copy running-config startup-config3、reload:重新启动设备示例:reload4、exit:退出CLI命令行模式示例:exit本文档涉及附件:1、无附件本文所涉及的法律名词及注释:1、ACL(Access Control List):访问控制列表,用于控制网络流量的进出。

2024版思科网络交换机配置命令详细总结归纳

2024版思科网络交换机配置命令详细总结归纳
使用`interface`命令进入接口配置模式, 如`interface FastEthernet 0/1`进入 FastEthernet 0/1接口。
VLAN间路由配置
01 02 03 04
使用`interface`命令进入三层接口配置模式,如`interface vlan 10`进入 VLAN 10的三层接口。
源端口和目的端口散列
同时考虑数据包的源端口和目的端口进行负载均衡。
配置负载均衡策略
在全局配置模式下使用`port-channel load-balance`命令进行配置。
端口聚合故障排除技巧
01
检查物理连接
确保所有参与聚合的物理端口都已 正确连接。
03
检查交换机配置
确认交换机的配置是否正确,包括 聚合模式、聚合组号等。
限制登录用户
指定允许通过SSH远程登录的用户或用户组。
交换机日志与审计功能启用
启用日志功能
将交换机操作记录到日志文件中,方便后续 审计和分析。
远程日志服务器
将日志文件发送到远程日志服务器进行集中 存储和管理。
配置日志级别
根据需要设置日志记录的详细程度(如信息、 警告、错误等)。
审计功能
启用审计功能,对特定操作进行实时监控和 记录。
思科网络交换机配置命令详细 总结归纳
目 录
• 交换机基本配置 • VLAN配置与管理 • 生成树协议(STP)配置与优化 • 端口聚合(EtherChannel)配置与应用 • 交换机安全性设置与加固 • 交换机性能监控与故障排除
01
交换机基本配置
交换机登录与访问控制
1 2
通过控制台端口登录 使用终端仿真软件通过控制台端口连接到交换机, 输入用户名和密码进行登录。

思科交换机路由常用命令基础

思科交换机路由常用命令基础

思科交换机路由常用命令基础1. 计算机命令:PCA login: root ;使用root用户password: linux ;口令是linux# shutdown -h now ;同init 0 关机# logout# login# ifconfig ;显示IP地址# ifconfig eth0 <ip address> netmask <netmask> ;设置IP 地址# ifconfig eht0 <ip address> netmask <netmask> down ;删除IP地址# route add 0.0.0.0 gw <ip># route del 0.0.0.0 gw <ip># route add default gw <ip> ;设置网关# route del default gw <ip> ;删除网关# route ;显示网关# ping <ip># telnet <ip>2. 交换机支持的命令:交换机基本状态:switch: ;交换机的ROM状态rommon> ;路由器的ROM状态hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname <hostname> ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xxswitch#exit ;返回命令交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlanswitch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain <name> ;设置发vtp域名switch(config)#vtp password <word> ;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address <IP> <mask> ;设置IP地址switch(config)#ip default-gateway <IP> ;设置默认网关switch#dir flash: ;查看闪存交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息3. 路由器支持的命令:路由器显示命令:router#show run ;显示配置信息router#show interface ;显示接口信息router#show ip route ;显示路由信息router#show cdp nei ;显示邻居信息router#reload ;重新起动路由器口令设置:router>enable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#hostname <hostname> ;设置交换机的主机名router(config)#enable secret xxx ;设置特权加密口令router(config)#enable password xxb ;设置特权非密口令router(config)#line console 0 ;进入控制台口router(config-line)#line vty 0 4 ;进入虚拟终端router(config-line)#login ;要求口令验证router(config-line)#password xx ;设置登录口令xxrouter(config)#(Ctrl+z) ;返回特权模式router#exit ;返回命令路由器配置:router(config)#int s0/0 ;进入Serail接口router(config-if)#no shutdown ;激活当前接口router(config-if)#clock rate 64000 ;设置同步时钟router(config-if)#ip address <ip> <netmask> ;设置IP地址router(config-if)#ip address <ip> <netmask> second ;设置第二个IProuter(config-if)#int f0/0.1 ;进入子接口router(config-subif.1)#ip address <ip> <netmask> ;设置子接口IProuter(config-subif.1)#encapsulation dot1q <n> ;绑定vlan 中继协议router(config)#config-register 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导路由器文件操作:router#copy running-config startup-config ;保存配置router#copy running-config tftp ;保存配置到tftprouter#copy startup-config tftp ;开机配置存到tftprouter#copy tftp flash: ;下传文件到flashrouter#copy tftp startup-config ;下载配置文件ROM状态:Ctrl+Break ;进入ROM监控状态rommon>confreg 0x2142 ;跳过配置文件rommon>confreg 0x2102 ;恢复配置文件rommon>reset ;重新引导rommon>copy xmodem:<sname> flash:<dname> ;从console传输文件rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IPrommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IPrommon>TFTP_FILE=c2600.bin ;指定下载的文件rommon>tftpdnld ;从tftp下载rommon>dir flash: ;查看闪存内容rommon>boot ;引导IOS静态路由:ip route <ip-address> <subnet-mask> <gateway> ;命令格式router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例动态路由:router(config)#ip routing ;启动路由转发router(config)#router rip ;启动RIP路由协议。

思科交换机的基本配置命令学习

思科交换机的基本配置命令学习

思科交换机的基本配置命令学习思科交换机的基本配置命令学习CISCO交换机基本配置:Console端口连接用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname csico ;设置交换机的主机名switch(config)#enable secret csico1 ;设置特权加密口令switch(config)#enable password csico8 ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;虚拟终端允许登录switch(config-line)#password csico6 ;设置虚拟终端登录口令csico6switch#exit ;返回命令交换机VLAN创建,删除,端口属性的设置,配置trunk端口,将某端口加入vlan中,配置VTP:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#vlan 3 name vlan3 ;建VLAN 3并命名为vlan3 switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config)#speed ? 查看speed命令的子命令switch(config)#speed 100 设置该端口速率为100mb/s (10/auto)switch(config)#duplex ? 查看duplex的子命令switch(config)#duplex full 设置该端口为全双工(auto/half)switch(config)#description TO_PC1 这是该端口描述为TO_PC1 switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为trunk模式(access模式)switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlanswitch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain vtpserver ;设置vtp域名相同switch(config)#vtp password ;设置发vtp密码switch(config)#vtp server ;设置vtp服务器模式switch(config)#vtp client ;设置vtp客户机模式交换机设置IP地址,默认网关,域名,域名服务器,配置和查看MAC地址表:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address 192.168.1.1 255.255.255.0 ;设置IP地址switch(config)#ip default-gateway 192.168.1.6 ;设置默认网关switch(config)#ip domain-name /doc/b05509978.html, 设置域名switch(config)#ip name-server 192.168.1.18 设置域名服务器switch(config)#mac-address-table? 查看mac-address-table 的子命令switch(config)#mac-address-table aging-time 100 设置超时时间为100msswitch(config)#mac-address-table permanent 0000.0c01.bbcc f0/3 加入永久地址在f0/3端口switch(config)#mac-address-table restricted static 0000.0c02.bbcc f0/6 f0/7 加入静态地址目标端口f0/6源端口f0/7 switch(config)#endswitch#show mac-address-table 查看整个MAC地址表switch#clear mac-address-table restricted static 清除限制性静态地址交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息switch#show int f0/0 status;查看指定端口状态switch#dir flash: ;查看闪存Cisco路由器配置命令大全网络2010-06-26 06:43:44 阅读657 评论0 字号:大中小订阅 .(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号或旧的来进行修改。

思科交换机配置命令大全

思科交换机配置命令大全

交换机配置1、基本配置:Switch >enable /进入特权模式Switch#conf t /进入全局配置模式Switch (conf-if)#duplex full/half/auto /有full , half, auto 三个可选switch# erase startup-configure / 恢复出场配置switch# reload / 重启交换机远程登录和con口还有接口配置和路由器配置命令一样,不再下面总结。

2配置VLAN和TRUNKSwitch(config)# vlan xxx /创建一个VLANSwitch(config-vlan)# name xxx /给VLAN命名或Switch# vlan database /进入保存VLAN配置的配置文件Switch(vlan)# vlan 20 name test20 /创建VLAN并给它命名Switch(config-if)# switchport mode access /配置端口模式是accessSwitch(config-if)# switchport access vlan xxx / 把接口划入一个VLAN Switch(config-if)#switchport trunk encapsulation {isl | dot1q | negotiate} /配置trunk封装ISL 或 802.1Q 或自动协商Switch(config-if)#switchport mode {dynamic {auto | desirable} | trunk} /配置二层trunk模式。

Switch(config-if)#switchport trunk allowed vlan {add | all | except | remove} vlan-list可选) / 配置trunk允许的VLAN3查看命令switch#show version /察看系统中的所有版本信息switch#show interface vlan xxx /查看交换机有关ip 协议的配置信息switch#show running-configure /查看交换机当前起作用的配置信息switch#show interface fastethernet xxx /察看交换机xxx接口具体配置和统计信息switch#show mac-address-table /查看mac 地址表switch#show mac-address-table aging-time / 查看mac 地址表自动老化时间4 cdp 相关命令switch#show cdp / 查看设备的cdp 全局配置信息switch#show cdp interface fastethernet xxx /查看xxx 端口的cdp 配置信息switch#show cdp traffic / 查看有关cdp 包的统计信息switch#show cdp nerghbors / 列出与设备相连的cisco 设备VTP配置switch# vlan databaseswitch(vlan)# vtp domain xxx / 配置VTP名字Switch(vlan)#vtp server / 配置VTP模式为serverSwitch(vlan)#vtp client / 配置VTP模式为clientSwitch(vlan)#vtp password xxx / 配置VTP密码switch(vlan)# vtp pruning / 开启VTP剪裁switch#show vtp domain /显示管理域的VTP 参数还有没总结的,我会抓紧时间完善。

思科交换机配置命令大全

思科交换机配置命令大全

思科交换机配置命令大全switch>用户模式1:进入特权模式enableswitch>enableswitch#2:进入全局配置模式configure terminalswitch>enableswitch#c onfigure terminalswitch(conf)#3:交换机命名hostname aptech2950以aptech2950为例switch>enableswitch#c onfigure terminalswitch(conf)#hostname aptch-2950aptech2950(conf)#4:配置使能口令enable password cisco以cisco为例switch>enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)#enable password cisco5:配置使能密码enable secret ciscolab以cicsolab为例switch>enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)#enable secret ciscolab6:设置虚拟局域网vlan1interface vlan1switch>enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)#interface vlan1aptech2950(conf-if)#ip address192.168.1.1255.255.255.0配置交换机端口ip和子网掩码aptech2950(conf-if)#no shut是配置处于运行中aptech2950(conf-if)#exitaptech2950(conf)#ip default-gateway192.168.254设置网关地址7:进入交换机某一端口interface fastehernet0/17以17端口为例switch>enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)#interface fastehernet0/17aptech2950(conf-if)#8:查看命令showswitch>enableswitch#show version察看系统中的所有版本信息show interface vlan1查看交换机有关ip协议的配置信息show running-configure查看交换机当前起作用的配置信息show interface fastethernet0/1察看交换机1接口具体配置和统计信息show mac-address-table查看mac地址表show mac-address-table aging-time查看mac地址表自动老化时间9:交换机恢复出厂默认恢复命令switch>enableswitch#erase startup-configureswitch#reload10:双工模式设置switch>enableswitch#c onfigure terminalswitch2950(conf)#hostname aptch-2950aptech2950(conf)#interface fastehernet0/17以17端口为例aptech2950(conf-if)#duplex full/half/auto有full,half,auto三个可选项11:cdp相关命令switch>enableswitch#show cdp查看设备的cdp全局配置信息show cdp interface fastethernet0/17查看17端口的cdp配置信息show cdp traffic查看有关cdp包的统计信息show cdp nerghbors列出与设备相连的cisco设备12:csico2950的密码恢复拔下交换机电源线。

Cisco(思科)交换机常用配置

Cisco(思科)交换机常用配置

…………………………………………………………………Cisco交换机相关设置…………………………………………………………………一、常用设置SW 〉用户模式SW 〉enable 进入特权模式SW # 特权模式SW # config terminal 进入全局配置模式SW(config)# 全局配置模式SW(config)# enable password 123 设置特权非加密密码为123 SW(config)# enable secret 123 设置特权加密密码为123 SW # show running-config (或sh run )查看当前配置SW # wr 保存当前配置SW(config)#no ip domain lookup 关闭域名查找SW(config)# hostname huarun 将交换机名改为huarun SW # reload 重启交换机二、端口配置1,基本配置(以端口1为例)SW(config)# interface fastethernet 0/1 进入交换机1端口(百兆)SW(config-if) # speed 10/100/auto 速率为10M/100M/自动SW(config-if) # duplex full/half/auto 模式为全双工/半双工/自动SW(config-if) # description caiwu 对端口描述SW(config-if) # end 退出端口配置SW# sh interface fastethernet 0/1 查看端口1的配置情况2,端口与主机MAC地址绑定(以端口1为例)SW(config)# interface fastethernet 0/1SW(config-if)# switchport mode accessSW(config-if)# switchport port-securitySW(config-if)# switchport port-security maximum 1SW(config-if)# switchport port-security mac-address mac地址3,端口镜像(端口1为目的端口——即监听端口;端口2和端口3为源端口——即被监听端口)SW(config)# interface fastethernet 0/1SW(config-if)# port monitor fastethernet 0/2SW(config-if)# port monitor fastethernet 0/34,端口汇聚(又叫做端口聚合)(以交换机的1口和2口为例)SW(config)# interface fastethernet 0/1SW(config-if)# switchport mode trunk(如果有多个vlan,需要配置,没有的话就不用了)SW(config-if)# speed 100SW(config-if)# duplex fullSW(config-if)# channel-group 1 mode onSW(config)# interface fastethernet 0/2SW(config-if)# switchport mode trunkSW(config-if)# speed 100SW(config-if)# duplex fullSW(config-if)# channel-group 1 mode on或者SW(config)#interface range fastethernet 0/1 -2SW(config-range-if)# speed 100SW(config-range-if)# duplex fullSW(config-range-if)# channel-group 1 mode on三、HSRP配置(hot standby router protocol)以华润地产为例:2台3750交换机,就一个vlan——默认的vlan1,路由器接2台3750交换机(做HSRP),每台3750都与内网汇聚交换机(huawei)相连接。

(整理)思科交换机配置命令

(整理)思科交换机配置命令
switch(config)#interface f0/2
switch(config-if)#sw a v 30
switch(config-if)#switchport access vlan 30
24
验证VLAN配置信息
验证VLAN配置信息
switch#sh vlan b
switch#show vlan brief
switch(config)#ip default-gateway 192.168.0.1
16
查看交换机的MAC地址表
查看交换机的MAC地址表
switch#sh mac-a
switch#show mac-address-table
17
查看思科交换机相邻设备的详细信息
查看思科交换机相邻设备的详细信息
switch#sh cdp nei de
benet(config)#
7
配置进入特权模式的明文口令
配置进入特权模式的明文口令
switch(config)#en pass 123
switch(config)#enable password 123
8
删除进入特权模式的明文口令
删除进入特权模式的明文口令
switch(config)#no ena pass
30
验证接口模式(检查中断端口允许的VLAN列表)
验证接口模式(检查中断端口允许的VLAN列表)
switch#sh int f0/15 switchp
switch#show interface f0/15 switchport
31
查看用过的命令
查看用过的命令
switch#sh hi
switch#show history

CISCO交换机配置命令大全

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-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)# 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-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,可以使用下列命令: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高速缓存区的内容。

思科交换机命令大全-思科交换机命令

思科交换机命令大全-思科交换机命令

思科交换机常用命令大全1.1 用户模式与特权模式用户模式:可以使用一些基本的查询命令特权模式:可以对交换机进行相关的配置进入特权模式命令:Switch>enable退出特权模式命令:Switch#exit启用命令查询:?时间设置:Switch#clock set 时间(自选参数,参数必须符合交换机要求)显示信息命令:Switch#show 可选参数注意:可以用TAB键补齐命令,自选参数为用户自定义参数,可选参数为交换机设定参数查看交换机配置: Switch#show running-config保存交换机配置:Switch#copy running-config startup-configSwitch#wr查看端口信息:Switch#show interface查看MAC地址表:Switch#show mac-address-table查看交换机CPU的状态信息:Switch#show processes1.2 全局配置模式进入全局配置模式:Switch#configure terminal主机名修改:Switch(config)#hostname 主机名(自选参数)特权模式进入密码: Switch(config)#enable secret 密码(自选参数)取消特权模式密码:Switch(config)#no enable secret取消主机名设置: Switch(config)#no hostname退出配置模式: Switch(config)#exit需要特别注意的是在配置模式中无法使用show命令,如果要使用的话show前必须加do和空格,例如:do show *指定根交换机命令:Switch(config)#spanning-tree vlan 自选参数(VLAN号)root primary例如: Switch(config)#spanning-tree vlan 1 root primary需要注意的是:设置根交换机是基于VLAN的关闭生成树协议命令:Switch(config)#no spanning-tree vlan 自选参数(VLAN 号)例如: Switch(config)#no spanning-tree vlan 11.3 接口配置模式进入接口配置模式:Switch(config)#interface 端口名称(可选参数)启用端口:Switch(config-if)#no shutdown停用端口:Switch(config-if)#shutdown进入同种类型多端口配置:Switch(config)# interface range fastethernet 0/1-5进入不同类型多端口配置:Switch(config)#interface range fastethernet 0/1-5,gigabitethernet 0/1-2退出接口配置模式:Switch(config-if)#exit1.4 二层端口的配置端口速率: Switch(config-if)#speed 可选参数双工模式: Switch(config-if)#duplex 可选参数禁用链路协商:Switch(config-if)#no negotiation auto 启用链路协商:Switch(config-if)#negotiation auto1.5 VLAN的配置新建VLAN:Switch(config)#vlan 自选参数(VLAN号)Switch(config-vlan)#name自选参数(VLAN名)例如:Switch(config)#vlan 1Switch(config-vlan)#name lab1Switch(config-vlan)#exit删除VLAN: Switch#vlan databaseSwitch(vlan)#no vlan 自选参数(vlan号)例如:Switch#vlan databaseSwitch(vlan)#no vlan 2将一个接口加入VLAN:Switch(config)#interface 可选参数(接口号)Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 自选参数(VLAN号)Switch(config-if)#no shutdownSwitch(config-if)#exit例如:Switch(config)#interface f0/1Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 1Switch(config-if)#no shutdownSwitch(config-if)#exit将一个接口退出VLAN:Switch(config)#interface 可选参数(接口号)Switch(config-if)#no switchport access vlan 自选参数(VLAN号)例如:Switch(config)#interface f0/1Switch(config-if)#no switchport access vlan 2修改一个接口为端口汇聚模式Switch(config)#interface 可选参数(接口号)Switch(config-if)#switchport mode trunkVLAN的验证命令:Switch#show vlan 显示VLAN列表Switch#show interface switchport 查看具体接口的VLAN成员资格信息1.6 VTP的配置VTP Domain Name(VTP域名)Switch#configure terminalSwitch(config)#vtp domain 自选参数例如: Switch(config)#vtp domain Lab_NetworkVTP mode(VTP模式)Switch(config)#vtp mode 可选参数(Server|Client| Transparent)例如: Switch(config)#vtp mode ServerVTP Pruning(VTP修剪)Switch(config)#vtp pruning注意:有的交换机不支持VTP修剪命令查看VTP的配置命令:Switch#show vtp status显示交换机运行的VTP模式,配置修订号和交换机所属的VTP域Switch#show vtp counters显示VTP消息相关的统计数据1.7 远程登录交换机设置配置管理VLAN:Switch(conf)#interface vlan 1Switch(config-if)#ip address x.x.x.x 255.255.255.0Switch(config-if)#no shutdown注意:IP地址必须与远程连接交换机的PC机地址在同一网段在交换机上指定默认网关:Switch(config)#ip default-gateway x.x.x.x注意:指定的默认网关仅当前交换机有效。

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

思科交换机-常用命令及配置
switch> 用户模式
1:进入特权模式enable
switch> enable
switch#
2:进入全局配置模式configure terminal
switch> enable
switch#configure terminal
switch(conf)#
3:交换机命名hostname name 以cisco001 为例
switch> enable
switch#c onfigure terminal
switch(conf)#hostname cisco001
cisco001(conf)#
4:配置使能口令(未加密)enable password cisco 以cisco 为例switch> enable
switch#configure terminal
cisco001(conf)# enable password cisco
5:配置使能密码(加密)enable secret ciscolab 以cicsolab 为例switch> enable
switch#configure terminal
switch(conf)# enable secret ciscolab
6:设置虚拟局域网vlan 1 interface vlan 1
switch> enable
switch#configure terminal
switch(conf)# interface vlan 1
switch(conf)# ip address 192.168.1.1 255.255.255.0 配置交换机端口ip 和子网掩码
switch (conf-if)#no shut 激活端口
switch (conf-if)#exit
switch (conf)#ip default-gateway 192.168.254 设置网关地址
7:进入交换机某一端口interface fastehernet 0/17 以17 端口为例
switch> enable
switch#configure terminal
switch(conf)# interface fastehernet 0/17
switch(conf-if)#
8:查看命令show
switch> enable
switch# show version 察看系统中的所有版本信息
show interface vlan 1 查看交换机有关ip 协议的配置信息
show running-configure 查看交换机当前起作用的配置信息
show interface fastethernet 0/1 察看交换机1 接口具体配置和统计信息
show mac-address-table 查看mac 地址表
9:交换机恢复出厂默认恢复命令
switch> enable
switch# erase startup-configure
switch# reload
10:交换机的密码恢复
拔下交换机电源线。

用手按着交换机的MODE 键,插上电源线
在switch:后执行flash_ini 命令:switch: flash_ini
查看flash 中的文件:switch: dir flash:
把“config.text”文件改名为“config.old”:switch: rename flash: config.text flash: config.old
执行boot:switch: boot
交换机进入是否进入配置的对话,执行no :
进入特权模式察看flash 里的文件:show flash :
把“config.old”文件改名为“config.text”:switch: rename flash: config.old flash: config.text
把“ config.text ” 拷入系统的“ running-configure ”:copy flash: config.text system :
running-configure
重新设置密码并保存。

11.交换机telnet 远程登录设置:
switch>en
switch#configure terminal
swich(conf)#enable password cisco 以cisco 为特权模式密码swich(conf)#interface vlan 1 以vlan 1端口作为远程登录的接口,其他端口亦可
swich(conf-if)#ip address 192.168.1.1 255.255.255.0
swich(conf-if)#no shut
swich(conf-if)#exit
swich(conf)line vty 0 4 设置0-4 个用户可以telnet 远程登陆swich(conf-line)#login
swich(conf-line)#password 123456
12.交换机ssh远程登录设置:
a.设定一个非默认的hostname
Switch(config)#hostname cisco
b.配置域名:
cisco(config)#ip domain-name test
c.指定加密长度:
cisco(config)#crypto key generate rsa
How many bits in the modulus [512]: 1024
% Generating 1024 bit RSA keys, keys will be
non-exportable...[OK]
d.将vty线路下的登录方式改为ssh
cisco(config)#line vty 0 4
cisco(config-line)#transport in ssh
13.配置vtp同步
说明:VTP(VLAN Trunking Protocol):是VLAN中继协议,它是思科私有协议。

作用是同步各个交换机之间的VLAN信息。

相关文档
最新文档