|
类别 |
命令格式 |
命令含义 |
|
基本配置 |
S> enable |
进入特权模式 |
|
S# configure terminal |
进入全局配置模式 |
|
S(config)# hostname name |
改变交换机名称 |
|
S(config)# enable password level level_# password |
设置用户口令(level_#=1)或特权口令(level_#=15) |
|
S(config)# line console 0 |
进入控制台接口 |
|
S(config-line)# password console_password |
接上一条命令,设置控制台口令 |
|
S(config)# line vty 0 15 |
进入虚拟终端 |
|
S(config-line)# password telnet_password |
接上一条命令,设置Telnet口令 |
|
S(config-line)# login |
允许Telnet登录 |
|
S(config)# enable password|secret privilege_password |
配置特权口令(加密或不加密) |
|
S(config)# interface ethernet|fastethernet|gigabitethernet slot_#/port_# |
进入接口子配置模式 |
|
S(config-if)# [no] shutdown |
关闭或启用该接口(默认启用) |
|
S(config)# ip address IP_address sunbet_mask |
指定IP地址 |
|
S(config)# ip default-gateway router's_IP_address |
指定哪台路由器地址为默认网关 |
|
S# show running-config |
查看当前的配置 |
|
S# copy running-config startup-config |
将RAM中的当前配置保存到NVRAM中 |
|
S> show interface [type slot_#/port_#] |
查看所有或指定接口的信息 |
|
S> show ip |
显示交换机的IP配置(只在1900系列上可用) |
|
S> show version |
查看设备信息 |
|
S# show ip interface brief |
验证IP配置 |
|
S(config-if)# speed 10|100|auto |
设置接口速率 |
|
S(config-if)# duplex auto|full|half |
设置接口双工模式 |
|
S> show mac-address-table |
查看CAM表 |
|
S# clear mac-address-table |
清除CAM表中的动态条目 |
|
1900(config)# mac-address-table permanent MAC_address type [slot_#/]port_# |
在CAM表中创建静态条目 |
|
2950(config)# mac-address-table static MAC_address vlan VLAN_# interface type [slot_#/] port_# |
在CAM表中创建静态条目 |
|
1900(config)# mac-address-table restricted static MAC_address source_port list_of_allowed_interface |
设置静态端口安全措施 |
|
1900(config-if)# port secure |
启用粘性学习 |
|
1900(config-if)# port secure max-mac-count value |
设置粘性学习特性能够学到的地址数量(默认132,取值范围是1-132) |
|
1900(config)# address-violation suspend|ignore|disable |
改变安全选项 |
|
1900> show mac-address-table security |
验证端口安全措施 |
|
2950(config)# switchport mode access |
定义接口为主机端口而不是中继端口 |
|
2950(config)# switchport port-security |
启用端口安全措施 |
|
2950(config)# switchport port-security maximum value |
指定可与此接口相关的设备的最大数量 |
|
2950(config)# switchport port-security violation protect|restrict|shutdown |
指定出现安全违规时应该发生的事 |
|
2950(config)# switchport port-security mac-address MAC_address |
指定允许与此接口相关的确切的MAC地址 |
|
2950(config)# switchport port-security mac-address sticky |
启用粘性学习特性 |
|
2950(config)# show port interface type [slot_#/] port_# |
验证接口配置 |
|
2950(config-if) description name |
设置接口描述信息 |
|
2950# show buffers |
查看系统缓存的大小 |
|
1900# copy nvram tftp:// IP_address_of_TFTP_server/ file_name |
|