2024年4月17日发(作者:)
思科交换机配置命令大全
switch>用户模式
1:进入特权模式enable
switch>enable
switch#
2:进入全局配置模式configureterminal
switch>enable
switch#configureterminal
switch(conf)#
3:交换机命名hostnameaptech2950
switch>enable
switch#configureterminal
switch(conf)#hostnameaptch-2950
aptech2950(conf)#
4:配置使能口令enablepasswordcisco
switch>enable
switch#configureterminal
switch(conf)#hostnameaptch2950
aptech2950(conf)#enablepasswordcisco
5:配置使能密码enablesecretciscolab
switch>enable
switch#configureterminal
switch(conf)#hostnameaptch2950
aptech2950(conf)#enablesecretciscolab
以aptech2950为例
以cisco为例
以cicsolab为例
6:设置虚拟局域网vlan1interfacevlan1
switch>enable
switch#configureterminal
switch(conf)#hostnameaptch2950
aptech2950(conf)#interfacevlan1
aptech2950(conf-if)#ipaddress192.168.1.1255.255.255.0
码
aptech2950(conf-if)#noshut
aptech2950(conf-if)#exit
aptech2950(conf)#ipdefault-gateway192.168.254
7:进入交换机某一端口interfacefastehernet0/17
switch>enable
switch#configureterminal
配置交换机端口ip和子网掩
是配置处于运行中
设置网关地址
以17端口为例
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
aptech2950(conf-if)#duplexfull/half/auto
项
以17端口为例
有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:
把“”文件改名为“”:switch:renameflash:ash:
执行boot:switch:boot
交换机进入是否进入配置的对话,执行no:
进入特权模式察看flash里的文件:showflash:


发布评论