0
点赞
收藏
分享

微信扫一扫

思科交换机常用命令汇总


思科交换机常用命令汇总

show version

show running-config

show vlan brief

show ip interface brief

show running-config interface f0/1

show ip route

show inventory//显示设备SN、设备名

更换MAC地址

在网管服务器上找到相应的报警信息,记录下交换机的IP地址及端口号。telnet交换机的IP地址(这里使用CRT)

#show running-configuration interface f0/1

右键标记,选择有MAC地址的那行命令,回车

conf t

interface f0/1

no 右键粘贴//删除原先绑定的MAC地址,这个端口会自动学习到新的MAC

end

show run interface f0/1

wr   //一定要保存配置MAC地址绑定才能生效

更改业务

show vlan brie

conf t

interface f0/1

switchport access vlan 2//把端口加入新的VLAN中

end

show run interface f0/1

wr


新增端口

conf t

show run interface f0/1

switchport port-security

switchport port-security violation restrict

switchport port-security mac-address sticky

如果没有配置过,则打开一个配置过的端口

复制除VLAN和绑定MAC地址以外的命令行

switchport access vlan 2

no shutdownend

show run interface f0/1

看到端口在VLAN2中,已经学到MAC地址

wr

清除MAC记录

no switchport port-security mac-address sticky 

XXXX.XXXX.XXXX vlan access

关闭端口

清除MAC地址

interface f0/1

shutdown


关闭端口安全

interface f0/1

no switchport port-security


备份配置

copy run tftp

Address or name of remote host []? 192.168.32.1

Destination filename [config.text]?TEST-3560-1 


恢复配置

copy tftp: run

Address or name of remote host []? 192.168.32.1

Source filename []? test.text

Destination filename [running-config]? 


清除配置

清除交换机配置命令:write erase

当然也可以使用erase startup-config就可以实现清除了

删除VLAN信息:delete flash:vlan.dat



IOS升级​

1.确保路由器与服务器的连通性(路由器配IP地址)


2.从服务器更新IOS镜像

#copy tftp flash

[]192.168.1.100服务器的地址

[]c1841-advipservicesk9-mz.124-15.Tw.bin新IOS的名称,注意大小写

[]复制过来后的名称

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!...!!!!!!开始复制文件


3.察看并删除旧的IOS(在需要更新的路由器上进行操作)

#show flash察看要删除的镜像名称

#delete flash

[]c1841-ipbasek9-mz.124-12.bin输入删除的镜像名称,注意大小写


4.重新配置系统并重启

(c)#no boot system flash 旧镜像名不让系统从旧的镜像启动

(c)#boot system flash 新镜像名称让系统以新镜像启动

#copy running-config startup-config将新的配置写到NVROM中


5.重启

#reload

举报

相关推荐

0 条评论