CISCO交换机常用维护手册 下载本文

内容发布更新时间 : 2024/9/28 12:57:17星期一 下面是文章的全部内容请认真阅读。

基本信息配置

1. 用en进全局模式下,再用conf t,进入配置模式,进行以下的配置:

管理方面的配置:

enable secret 0 xxxxx

line vty 0 4

exec-timeout 30 0 password 0 xxxx

login

service password-encryption 2. 时间设置与查看命令:

Switch# clock set 11:11:11 14 feb 2011 Switch# show clock 3. 主机名设置:

Switch(config)# hostname RRR 4. 主机信息查看:

Switch#show version //用来查看启动时间,硬件配置,IOS版本,上次启动方式,存储器使用

状态等信息。 5. 配置信息:

Switch#show running-config //查看内存RAM配置信息,当前工作状态时的配置信息。 Switch#show startup-config //查看NVRAM配置信息,启动时加载的配置信息。 6. 每日登录标语配置:

Banner motd # Forbidden Area # 7. CDP配置:

Show cdp interface //显示CDP邻居接口运行情况 Show cdp neighbors //显示cdp邻居信息 Show cdp neighbor detail //显示详细邻居信息

Switch(config-if)# no cdp enable //在端口上关闭cdp功能 Switch(config)# no cdp run // 关闭cdp功能 Switch#clear cdp table //删除cdp 表 8. 交换机模式转换命令: Switch> 用户模式 //默认登录 Switch# 特权模式 //enable

Switch(config)#全局模式 //configure terminal Switch(config-if)# 接口模式 //interface f0/0

Rommon> 交换机启动时给中断信号后进入的应急模式或高级操作模式

第 1 页 共 7 页

9. 启用三层交换功能

Switch(config)#ip routing

10 设置vlan n

Switch(config)#vlan 2

Switch(config-vlan)#name vlan 2 Switch(config)#exit

Switch(config-if)# switch mode access Switch(config-if)# switch mode access vlan 2 11 配置etherchannel

Switch(config)int port-channel 1 //建立捆绑口 Switch(config)int range fa0/1-2 //

Switch(config-if)channel-group 1 mode on // 将端口归属到捆绑口上 Switch(config-if)switchport mode trunk enc dot1q // 定义TRUNK封装 Switch(config-if)switchport mode trunk //

Switch(config)port-channel load-balance dst-ip //定义负载方式 检验命令: show etherchannel summary

第 2 页 共 7 页

常用端口配置

1配置接口速率和双工

Switch(config-if)#speed [10 | 100 | auto](速度) Switch(config-if)# duplex [auto | full | half](双工)

Switch(config-if)#des 描述字

Switch(config-if)#shutdown 关闭接口 Switch(config-if)#no sh 开启接口 2 配置三层接口

Switch(config-if)# ip add ip mask 3 配置trunk接口

Switch(config)# interface fastethernet x/y (以fastethernet为例,gigabitethernet一样)

Switch(config-if)# shutdown Switch(config-if)# switchport

Switch(config-if)# switchport mode dynamic desirable|trunk|auto Switch(config-if)# switchport trunk encapsulation dot1q Switch(config-if)# switchport trunk allowed vlan 2-3 Switch(config-if)# no shutdown Switch(config-if)# end Switch# exit 4端口划分vlan

Switch(config-if)# switch mode access Switch(config-if)# switch mode access vlan 2 5常用端口查看命令 Switch# show int fa0/0 Switch# show controllers s0/0 Switch# show ip interface fa0/0 Switch# show ip int brief

Switch# show vlan all //查看vlan信息 Switch#show int trunk //查看trunk 端口 6.修改NATIVE VLAN

Switch(config-if)# switchport trunk native vlan 10 7.交换机端口安全

Switch(config-if)# switch port-securitiy

Switch(config-if)# switch port-securitiy maximum 1 //设置端口绑定mac地址数量

Switch(config-if)# switch port-securitiy violation shutdown|protect|restrict //设置违规保护方式

第 3 页 共 7 页