思科交换机配置命令.docx

上传人:b****6 文档编号:8595894 上传时间:2023-02-01 格式:DOCX 页数:16 大小:20.99KB
下载 相关 举报
思科交换机配置命令.docx_第1页
第1页 / 共16页
思科交换机配置命令.docx_第2页
第2页 / 共16页
思科交换机配置命令.docx_第3页
第3页 / 共16页
思科交换机配置命令.docx_第4页
第4页 / 共16页
思科交换机配置命令.docx_第5页
第5页 / 共16页
点击查看更多>>
下载资源
资源描述

思科交换机配置命令.docx

《思科交换机配置命令.docx》由会员分享,可在线阅读,更多相关《思科交换机配置命令.docx(16页珍藏版)》请在冰豆网上搜索。

思科交换机配置命令.docx

思科交换机配置命令

思科交换机配置命令

  美国思科公司,凭借它的IOS,Cisco公司在多协议路由器市场上处于绝对领先的地位。

目前,在Internet中,有近80%的路由器来自Cisco。

下面给大家介绍思科交换机配置命令大全,一起来了解一下吧!

  思科交换机配置命令大全

  一、基本配置命令

  switch>用户模式

  1:

进入特权模式enable

  switch>enable

  switch#

  2:

进入全局配置模式configureterminal

  switch>enable

  switch#configureterminal

  switch(conf)#

  3:

交换机命名hostnameaptech2950以aptech2950为例

  switch>enable

  switch#configureterminal

  switch(conf)#hostnameaptch-2950

  aptech2950(conf)#

  4:

配置使能口令enablepasswordcisco以cisco为例

  switch>enable

  switch#configureterminal

  switch(conf)#hostnameaptch2950

  aptech2950(conf)#enablepasswordcisco

  5:

配置使能密码enablesecretciscolab以cicsolab为例

  switch>enable

  switch#configureterminal

  switch(conf)#hostnameaptch2950

  aptech2950(conf)#enablesecretciscolab

  6:

设置虚拟局域网vlan1interfacevlan1

  switch>enable

  switch#configureterminal

  switch(conf)#hostnameaptch2950

  aptech2950(conf)#interfacevlan1

  aptech2950(conf-if)#ipaddress192.168.1.1255.255.255.0配置交换机端口ip和子网掩码

  aptech2950(conf-if)#noshut是配置处于运行中

  aptech2950(conf-if)#exit

  aptech2950(conf)#ipdefault-gateway192.168.254设置网关地址

  7:

进入交换机某一端口interfacefastehernet0/17以17端口为例

  switch>enable

  switch#configureterminal

  switch(conf)#hostnameaptch2950

  aptech2950(conf)#interfacefastehernet0/17

  aptech2950(conf-if)#

  8:

查看命令show

  switch>enable

  switch#showversion察看系统中的所有版本信息

  showinterfacevlan1查看交换机有关ip协议的配置信息

  showrunning-configure查看交换机当前起作用的配置信息

  showinterfacefastethernet0/1察看交换机1接口具体配置和统计信息

  showmac-address-table查看mac地址表

  showmac-address-tableaging-time查看mac地址表自动老化时间

  9:

交换机恢复出厂默认恢复命令

  switch>enable

  switch#erasestartup-configure

  switch#reload

  10:

双工模式设置

  switch>enable

  switch#configureterminal

  switch2950(conf)#hostnameaptch-2950

  aptech2950(conf)#interfacefastehernet0/17以17端口为例

  aptech2950(conf-if)#duplexfull/half/auto有full,half,auto三个可选项

  11:

cdp相关命令

  switch>enable

  switch#showcdp查看设备的cdp全局配置信息

  showcdpinterfacefastethernet0/17查看17端口的cdp配置信息

  showcdptraffic查看有关cdp包的统计信息

  showcdpnerghbors列出与设备相连的cisco设备

  12:

csico2950的密码恢复

  拔下交换机电源线。

  用手按着交换机的MODE键,插上电源线

  在switch:

后执行flash_ini命令:

switch:

flash_ini

  查看flash中的文件:

switch:

dirflash:

  把“config.text”文件改名为“config.old”:

switch:

renameflash:

config.textflash:

config.old

  执行boot:

switch:

boot

  交换机进入是否进入配置的对话,执行no:

  进入特权模式察看flash里的文件:

showflash:

  把“config.old”文件改名为“config.text”:

switch:

renameflash:

config.oldflash:

config.text

  把“config.text”拷入系统的“running-configure”:

copyflash:

config.textsystem:

  running-configure

  把配置模式重新设置密码存盘,密码恢复成功。

  13:

交换机telnet远程登录设置:

  switch>en

  switch#configureterminal

  switch(conf)#hostnameaptech-2950

  aptech2950(conf)#enablepasswordcisco以cisco为特权模式密码

  aptech2950(conf)#interfacefastethernet0/1以17端口为telnet远程登录端口

  aptech2950(conf-if)#ipaddress192.168.1.1255.255.255.0

  aptech2950(conf-if)#noshut

  aptech2950(conf-if)#exit

  aptech2950(conf)linevty04设置0-4个用户可以telnet远程登陆

  aptech2950(conf-line)#login

  aptech2950(conf-line)#passwordedge以edge为远程登录的用户密码

  主机设置:

  ip192.168.1.2主机的ip必须和交换机端口的地址在同一网络

  段

  netmask255.255.255.0

  gate-way192.168.1.1网关地址是交换机端口地址

  运行:

  telnet192.168.1.1

  进入telnet远程登录界面

  password:

edge

  aptech2950>en

  password:

cisco

  aptech#

  14:

交换机配置的重新载入和保存

  设置完成交换机的配置后:

  aptech2950(conf)#reload

  是否保存(y/n)y:

保存设置信息n:

不保存设置信息

  二、高级配置命令

  1.在基于IOS的交换机上设置主机名/系统名:

  switch(config)#hostnamehostname

  在基于CLI的交换机上设置主机名/系统名:

  switch(enable)setsystemnamename-string

  2.在基于IOS的交换机上设置登录口令:

  switch(config)#enablepasswordlevel1password

  在基于CLI的交换机上设置登录口令:

  switch(enable)setpassword

  switch(enable)setenalbepass

  3.在基于IOS的交换机上设置远程访问:

  switch(config)#interfacevlan1

  switch(config-if)#ipaddressip-addressnetmask

  switch(config-if)#ipdefault-gatewayip-address

  在基于CLI的交换机上设置远程访问:

  switch(enable)setinterfacesc0ip-addressnetmaskbroadcast-address

  switch(enable)setinterfacesc0vlan

  switch(enable)setiproutedefaultgateway

  4.在基于IOS的交换机上启用和浏览CDP信息:

  switch(config-if)#cdpenable

  switch(config-if)#nocdpenable

  为了查看Cisco邻接设备的CDP通告信息:

  switch#showcdpinterface[typemodle/port]

  switch#showcdpneighbors[typemodule/port][detail]

  在基于CLI的交换机上启用和浏览CDP信息:

  switch(enable)setcdp{enable|disable}module/port

  为了查看Cisco邻接设备的CDP通告信息:

  switch(enable)showcdpneighbors[module/port][vlan|duplex|capabilities|detail]

  5.基于IOS的交换机的端口描述:

  switch(config-if)#descriptiondescription-string

  基于CLI的交换机的端口描述:

  switch(enable)setportnamemodule/numberdescription-string

  6.在基于IOS的交换机上设置端口速度:

  switch(config-if)#speed{10|100|auto}

  在基于CLI的交换机上设置端口速度:

  switch(enable)setportspeedmoudle/number{10|100|auto}

  switch(enable)setportspeedmoudle/number{4|16|auto}

  7.在基于IOS的交换机上设置以太网的链路模式:

  switch(config-if)#duplex{auto|full|half}

  在基于CLI的交换机上设置以太网的链路模式:

  switch(enable)setportduplexmodule/number{full|half}

  8.在基于IOS的交换机上配置静态VLAN:

  switch#vlandatabase

  switch(vlan)#vlanvlan-numnamevla

  switch(vlan)#exit

  switch#configureteriminal

  switch(config)#interfaceinterfacemodule/number

  switch(config-if)#switchportmodeaccess

  switch(config-if)#switchportaccessvlanvlan-num

  switch(config-if)#end

  在基于CLI的交换机上配置静态VLAN:

  switch(enable)setvlanvlan-num[namename]

  switch(enable)setvlanvlan-nummod-num/port-list

  9.在基于IOS的交换机上配置VLAN中继线:

  switch(config)#interfaceinterfacemod/port

  switch(config-if)#switchportmodetrunk

  switch(config-if)#switchporttrunkencapsulation{isl|dotlq}

  switch(config-if)#switchporttrunkallowedvlanremovevlan-list

  switch(config-if)#switchporttrunkallowedvlanaddvlan-list

  在基于CLI的交换机上配置VLAN中继线:

  switch(enable)settrunkmodule/port[on|off|desirable|auto|nonegotiate]

  Vlan-range[isl|dotlq|dotl0|lane|negotiate]

  10.在基于IOS的交换机上配置VTP管理域:

  switch#vlandatabase

  switch(vlan)#vtpdomaindomain-name

  在基于CLI的交换机上配置VTP管理域:

  switch(enable)setvtp[domaindomain-name]

  11.在基于IOS的交换机上配置VTP模式:

  switch#vlandatabase

  switch(vlan)#vtpdomaindomain-name

  switch(vlan)#vtp{sever|cilent|transparent}

  switch(vlan)#vtppasswordpassword

  在基于CLI的交换机上配置VTP模式:

  switch(enable)setvtp[domaindomain-name][mode{sever|cilent|transparent}][password

  password]

  12.在基于IOS的交换机上配置VTP版本:

  switch#vlandatabase

  switch(vlan)#vtpv2-mode

  在基于CLI的交换机上配置VTP版本:

  switch(enable)setvtpv2enable

  13.在基于IOS的交换机上启动VTP剪裁:

  switch#vlandatabase

  switch(vlan)#vtppruning

  在基于CLI的交换机上启动VTP剪裁:

  switch(enable)setvtppruningenable

  14.在基于IOS的交换机上配置以太信道:

  switch(config-if)#portgroupgroup-number[distribution{source|destination}]

  在基于CLI的交换机上配置以太信道:

  switch(enable)setportchannelmoudle/port-rangemode{on|off|desirable|auto}

  15.在基于IOS的交换机上调整根路径成本:

  switch(config-if)#spanning-tree[vlanvlan-list]costcost

  在基于CLI的交换机上调整根路径成本:

  switch(enable)setspantreeportcostmoudle/portcost

  switch(enable)setspantreeportvlancostmoudle/port[costcost][vlan-list]

  16.在基于IOS的交换机上调整端口ID:

  switch(config-if)#spanning-tree[vlanvlan-list]port-priorityport-priority

  在基于CLI的交换机上调整端口ID:

  switch(enable)setspantreeportpri{mldule/port}priority

  switch(enable)setspantreeportvlanpri{module/port}priority[vlans]

  17.在基于IOS的交换机上修改STP时钟:

  switch(config)#spanning-tree[vlanvlan-list]hello-timeseconds

  switch(config)#spanning-tree[vlanvlan-list]forward-timeseconds

  `switch(config)#spanning-tree[vlanvlan-list]max-ageseconds

  在基于CLI的交换机上修改STP时钟:

  switch(enable)setspantreehellointerval[vlan]

  switch(enable)setspantreefwddelaydelay[vlan]

  switch(enable)setspantreemaxageagingtiame[vlan]

  18.在基于IOS的交换机端口上启用或禁用PortFast特征:

  switch(config-if)#spanning-treeportfast

  在基于CLI的交换机端口上启用或禁用PortFast特征:

  switch(enable)setspantreeportfast{module/port}{enable|disable}

  19.在基于IOS的交换机端口上启用或禁用UplinkFast特征:

  switch(config)#spanning-treeuplinkfast[max-update-ratepkts-per-second]

  在基于CLI的交换机端口上启用或禁用UplinkFast特征:

  switch(enable)setspantreeuplinkfast{enable|disable}[rateupdate-rate][all-protocolsoff|on]

  20.为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个IP地址,然后使

  用下列命令:

switch(config)#clusterenablecluster-name

  21.为了从一条中继链路上删除VLAN,可使用下列命令:

  switch(enable)cleartrunkmodule/portvlan-range

  22.用showvtpdomain显示管理域的VTP参数.

  23.用showvtpstatistics显示管理域的VTP参数.

  24.在Catalyst交换机上定义TrBRF的命令如下:

  switch(enable)setvlanvlan-name[namename]typetrbrfbridgebridge-num[stp{ieee|ibm}]

  25.在Catalyst交换机上定义TrCRF的命令如下:

  switch(enable)setvlanvlan-num[namename]typetrcrf

  {ringhex-ring-num|decringdecimal-ring-num}parentvlan-num

  26.在创建好TrBRFVLAN之后,就可以给它分配交换机端口.对于以太网交换,可以采用如

  下命令给VLAN分配端口:

  switch(enable)setvlanvlan-nummod-num/port-num

  27.命令showspantree显示一个交换机端口的STP状态.

  28.配置一个ELAN的LES和BUS,可以使用下列命令:

  ATM(config)#interfaceatmnumber.subintmultioint

  ATM(config-subif)#laneserber-busethernetelan-name

  29.配置LECS:

  ATM(config)#lanedatabasedatabase-name

  ATM(lane-config-databade)#nameelan1-nameserver-atm-addressles1-nsap-address

  ATM(lane-config-databade)#nameelan2-nameserver-atm-addressles2-nsap-address

  ATM(lane-config-databade)#name…

  30.创建完数据库后,必须在主接口上启动LECS.命令如下:

  ATM(config)#interfaceatmnumber

  ATM(config-if)#laneconfigdatabasedatabase-name

  ATM(config-if)#laneconfigauto-config-atm-address

  31.将每个LEC配置到一个不同的ATM子接口上.命令如下:

  ATM(config)#interfaceatmnumber.subintmultipoint

  ATM(config)#lanecliente

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 工学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1