的常用操作项<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

1、             更改主机名       switch(config)#hostname sw1

2、             设置进入特权模式的密码
switch(config)#enable password 1234
switch(config)#enable secret cisco

3、             设置console口密码
switch(config)#line console 0
switch(config-line)#password 
123
switch(config-line)#login

4、             查看mac地址列表         switch#show mac-address-table

5、             查看mac地址列表刷新时间          switch#show mac-address-table aging-time

6、             更改mac地址列表刷新时间    switch(config)#mac-address-table aging-time 200

7、             查看当前配置(RAM      switch#show running-config

8、             查看交换机的配置(NVRAM  switch#show startup-config

9、             保存配置
switch#copy running-config  startup-config
switch#write

10、         恢复出厂默认设置
switch#erase startup-config
switch#reload

11、         查看cdp的全局信息        switch#show cdp

12、         查看接口的cdp配置信息        switch#show cdp interface f0/2

13、         查看有关cdp包的统计信息         switch#show cdp traffic

14、         查看邻居信息           switch#show cdp neighbors

15、         查看所有入口项的详细信息
switch#show cdp neighbors detail
switch#show cdp entry *

16、         添加接口的描述信息   switch(config-if)# description connection to routerA

17、         设置交换机的网关   switch(config)#ip default-gateway 192.168.1.1

18、         关掉DNS解析    switch(config)# no ip domain-lookup

19、         实现交换机的远程管理
switch(config)#enable secret cisco
switch(config)#intface valn 1
switch(config-if)#ip address
192.168.1.100 255.255.255.0
switch(config-if)#no shutdown
switch(config)#line vty 0 4
switch(config-line)#password 123
switch(config-line)#login
c:\>telnet 192.168.1.100

20、         交换机的密码恢复
1
、将交换机的电源拔下
2
、按mode键将电源插上,当出现switch:时将手松开
3
switch:flash_init      //加载到flash
4
switch:dir flash:      //查看flash中的文件
5
rename flash:config.text  flash:config.old //更改文件名
6
boot                 //重新启动交换机
7
rename flash:config.old  flash:config.text  //将文件名改回
8
copy flash:config.text  running-config
9
enable password  cisco            //重新设置密码

10write                           //保存

21、         创建vlan方法一
switch#vlan database
switch(vlan)#vlan  10  name  sc
switch(vlan)#exit

22、         创建vlan方法二
switch(config)#vlan 10
switch(config-vlan)#name sc

23、         删除vlan方法一
switch(vlan)#no vlan 10
switch(vlan)#exit

24、         删除vlan方法二    switch(config)#no vlan 10

25、         删除vlan方法三    switch#delete vlan.dat

26、         将端口加入到vlan   switch(config-if)#switchport access vlan 10

27、         将一组连续的端口加入到vlan
switch(config)# interface range f0/1
5
switch(config-if-range)#switchport access vlan 10

28、         <?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /> 将端口从vlan中删除
switch(config-if)#no switchport access vlan 10
switch(config-if)#switchport access vlan 1

switch(config-if-range)#no switchport access vlan 10
switch(config-if-range)#switchport access vlan 1

29、         查看所有vlan的摘要信息   switch#show vlan brief

30、         查看指定vlan的信息
switch#show vlan id 10

31、         Cisco 2600 路由器的基本操作
从用户模式进入特权模式
router>enable
router#
从特权模式进入全局配置模式
router#config  terminal
router(config)#
为路由器配置主机名
router(config)#hostname teacher
teacher(config)#
进入路由器的以太口配置模式
teacher(config)#interface fastethernet 0/0
teacher(config_if)#

32、         查看Cisco 2600路由器的串口状态
router#show interface serial 0/0
serial 0/0 is up
line protocol is up
可操作状态………serial 0/0 is up
line protocol is up
连接问题…………serial 0/0 is up
line protocol is down
接口问题…………serial 0/0 is down
line protocol is down
禁用状态…………serial 0/0 is administratively down line protocol is down