2024年4月7日发(作者:)

cisco 2950 常用配置命令

1、配置IP地址

交换机要能够被网管,必须给它标识一个管理IP地址,默认情况下CISCO交换机的VLAN 1为

管理VLAN,为该VLAN配上IP 地址,交换机就可以被网管了。命令如下:

a、进入全局模式: Switch#configure terminal

b、进入VLAN 1接口模式:Switch(config)#interface vlan 1

c、配置管理IP地址:Switch(config-if) # ip address [A.B.C.D]

如果当前VLAN 不是管理VLAN , 只需要将上面第b处命令的vlan的号码换成管理VLAN的号

码即可。

2、打开SNMP协议

a、进入全局模式: Switch#configure terminal

b、配置只读的Community,产品默认的只读Community名为public

Switch(config)#snmp-server community public ro

c、配置可写的Community,产品默认的可写Community名为private

Switch(config)#snmp-server community private rw

3、更改SNMP的Community密码

a、将设备分组,并使能支持的各种SNMP版本

Switch(config)#snmp-server group qycx123 v1

Switch(config)#snmp-server group qycx 123 v2c

b、分别配置只读和可写community 如:

Switch(config)#snmp-server group qycx123 v3 noauth

Switch(config)#snmp-server community qycx123 ro

4、保存交换机配置

Switch#copy run start

常用命令

Switch(config)#snmp-server community qycx123 rw

1、设置交换机密码

a、更改远程TELNNET密码

Switch#configure terminal

Switch(config)#line vty 0 4

Switch(config-line)#login

Switch(config-line)#exit

Switch(config-line)#password qycx123

b、更改进入全局配置模式时的密码

Switch#configure terminal

Switch(config)#enable secret qycx123

2、创建并划分VLAN

a、创建VLAN

Switch#vlan database

Switch(vlan)#vlan 99 name office

(创建vlan 99 并命名为office)

b、将端口划分至vlan

Switch(config)#interface fastEthernet 0/8

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 99

(将8号快速以太口划分至vlan 99)

3、常用调试命令

a、显示所有配置命令:Switch#show run

b、显示所有接口状态:Switch#show ip int brief

c、显示所有VLAN的信息:Switch#show vlan brief

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 查看设备信息