一、几种配置命令模式
switch> 这种提示符表示是在用户命令模式,只能使用一些查看命令。
switch# 这种提示符表示是在特权命令模式。
switch(config)# 这种提示符表示是全局配置模式
switch(config-if)# 端口配置命令模式
![8a7027433748f5c87d5ebaa3a69792ac.png](https://img-blog.csdnimg.cn/img_convert/8a7027433748f5c87d5ebaa3a69792ac.png)
二、检查、查看命令
这些命令是查看当前配置状况,通常是以show(sh)为开始的命令。
show version查看IOS的版本、
show flash查看flash内存使用状况、
show mac-address-table查看MAC地址列表
![4f0600179092b406b80709703afa4c98.png](https://img-blog.csdnimg.cn/img_convert/4f0600179092b406b80709703afa4c98.png)
![25710007ec52ff5d35a21efb204ae399.png](https://img-blog.csdnimg.cn/img_convert/25710007ec52ff5d35a21efb204ae399.png)
![16626a82d6752746e026209c2fd72b3e.png](https://img-blog.csdnimg.cn/img_convert/16626a82d6752746e026209c2fd72b3e.png)
Show ? 帮助命令显示当前所有的查看命令
![f3df2c7ccb07a3519c3466242bcec96a.png](https://img-blog.csdnimg.cn/img_convert/f3df2c7ccb07a3519c3466242bcec96a.png)
查看端口状态信息
三、密码设置命令
Cisco交换机、路由器中有很多密码,设置好这些密码可以有效地提高设备的安全性。 switch(config)#enable password 设置进入特权模式进的密码
switch(config-line) 可以设置通过console端口连接设备及telnet远程登录时所需要的密码
![0c75d6bb429f984b6fcf267423b1e611.png](https://img-blog.csdnimg.cn/img_convert/0c75d6bb429f984b6fcf267423b1e611.png)
、、
默认情况下,这些密码都是以明文的形式存储,所以很容易查看到。为了避免这种情况,我们可以以密文的形式存储各种密码:service password-encryption
![e16afc4054f88bd22c073140878f6960.png](https://img-blog.csdnimg.cn/img_convert/e16afc4054f88bd22c073140878f6960.png)
![86115e00ce1f437cf7e029c50f643742.png](https://img-blog.csdnimg.cn/img_convert/86115e00ce1f437cf7e029c50f643742.png)
密码以密文的形式存储
四、配置IP地址及默认网关
默认Vlan 1
Show vlan
![9bb976d17d23957056bfc3c97aa862c9.png](https://img-blog.csdnimg.cn/img_convert/9bb976d17d23957056bfc3c97aa862c9.png)
五、管理MAC地址表
switch#show mac-address-table 显示MAC地址列表
switch#clear mac-address-table dynamic 清除动态MAC地址列表
![cbc173ac94055fde97b023f65ba942fb.png](https://img-blog.csdnimg.cn/img_convert/cbc173ac94055fde97b023f65ba942fb.png)
![585fa9722a0ef1d4366066b855381c3e.png](https://img-blog.csdnimg.cn/img_convert/585fa9722a0ef1d4366066b855381c3e.png)
设置静态MAC地址
六、配置端口安全
switch(config-if)switchport port-security
switch(config-if)switchport port-security maximum 4
![1b78c89ba5529b20676229f94f05d3f8.png](https://img-blog.csdnimg.cn/img_convert/1b78c89ba5529b20676229f94f05d3f8.png)
![8527b5ea067a921b30b52ad71fcdfb6f.png](https://img-blog.csdnimg.cn/img_convert/8527b5ea067a921b30b52ad71fcdfb6f.png)