思科交换机配置命令有哪些?怎么配置CISCO交换机?

编辑: 或许
360集合包
360集合包
360集合包,一键装机、快捷方便。
立即下载   精品合集

  怎么配置CISCO交换机?如果没有经常配置交换机的经验,很多命令就会忘记,正如思科交换机配置使用的命令,因为是英文界面,我们需要一个对照,如果你在找这些命令可以阅读下文中提供的步骤,了解思科交换机配置命令有哪些。

  思科交换机配置方法:

  一、注意事项:

  1、交换机启动需要大约4-5分钟;

  2、网线插入交换机接口从黄变为绿需要大约1-2分钟,即进入正常工作模式;

  3、建议使用XP系统进行操作,2003默认没有安装超级终端,需要使用安装光盘添加该工具才有;

  4、请严格按照以下步骤进行,背景灰色字体为交换机显示信息,蓝色字体为配置命令。

  二、准备工作:

  1、先保持交换机断电状态;

  2、使用调试串口线连接笔记本电脑的串口与交换机背面的CONSOLE接口;

  3、打开超级终端:

  开始 → 所有程序 → 附件 → 超级终端;

  配置超级终端:

  名称 → cisco

  选择com1或com2(请依照实际情况进行选择)

  修改每秒位数为9600

  应用 → 确定 → 回车;

  三、初始配置:

  1、给交换机通电;

  2、片刻后会看到交换机的启动信息,直到出现以下配置选项:

  Would you like to terminate autoinstall? [yes/no]: no

  Would you like to enter the initial configuration dialog? [yes/no]:no

  Would you like to terminate autoinstall? [yes/no]: no

  四、出现命令窗口:

  Switch>

  五、备份出厂配置:

  Switch>en 进入特权模式

  Switch#copy running-config sfbak-config

  Destination filename [sfbak-config]?回车

  片刻后会出现:

  1204 bytes copied in 0.529 secs (2276 bytes/sec)

  表示文件备份成功。

  六、配置账号密码:

  Switch#configure terminal 进入配置子模式

  Switch(config)#enable password cisco 设置PASSWORD密码为cisco

  Switch(config)#enable secret cisco 设置SECRET密码为cisco

  Switch(config)#exit

  片刻后会出现:

  00:11:26: %SYS-5-CONFIG_I: Configured from console by console

  表示将配置保存到了内存中,在后面的配置过程中会出现类似的信息,属于正常现象。

  七、创建VLAN:

  Switch#show vlan 查看VLAN信息,默认有一个VLAN 1,并且所有端口都属于它

  Switch#vlan database 进入VLAN子模式

  片刻后会出现:

  % Warning: It is recommended to configure VLAN from config mode,

  as VLAN database mode is being deprecated. Please consult user

  documentation for configuring VTP/VLAN in config mode.

  属于正常的警告信息。

  Switch(vlan)#vlan 2 创建VLAN2

  片刻后会出现:

  VLAN 2 added:

  Name: VLAN0002

  表示VLAN创建成功。

  Switch(vlan)#vlan 3 创建VLAN3

  Switch(vlan)#exit

  八、为VLAN设置IP地址:

  为VLAN2设置IP地址

  Switch#configure terminal 进入配置子模式

  Switch(config)#interface vlan 2 配置IP,VLAN2

  Switch(config-if)#ip address 133.37.125.5 255.255.255.0 设置交换机IP(具体IP请依照实际情况设置)

  Switch(config-if)#exit

  为VLAN3设置IP地址

  Switch(config)#interface vlan 3 配置IP,VLAN3

  Switch(config-if)#ip address 192.168.1.5 255.255.255.0 设置交换机IP(具体IP请依照实际情况设置)

  Switch(config-if)#exit

  九、为VLAN划分交换机接口:

  配置1-12号电口为VLAN2

  Switch(config)#interface range fastEthernet 0/1 - 12 进入F0/1 到 F0/12

  Switch(config-if)#Switchport mode access 设成静态VLAN访问模式

  Switch(config-if)#Switchport access vlan 2 将此口分给VLAN2

  Switch(config-if)#exit

  ===================

  配置13-24号电口为VLAN3

  Switch(config)#interface range fastEthernet 0/13 - 24 进入F0/13 到 F0/24

  Switch(config-if)#Switchport mode access 设成静态VLAN访问模式

  Switch(config-if)#Switchport access vlan 3 将此口分给VLAN3

  Switch(config-if)#exit

  ===================

  配置1号光口为VLAN-2

  Switch(config)#interface GigabitEthernet 0/1 进入G0/1

  Switch(config-if)#Switchport mode access 设成静态VLAN访问模式

  Switch(config-if)#Switchport access vlan 2 将此口分给VLAN2

  Switch(config-if)#exit

  ===================

  配置2号光口为VLAN-3

  Switch(config)#interface GigabitEthernet 0/2 进入G0/2

  Switch(config-if)#Switchport mode access 设成静态VLAN访问模式

  Switch(config-if)#Switchport access vlan 3 将此口分给VLAN3

  Switch(config-if)#exit

  Switch(config)#exit

  十、关闭VLAN1:

  Switch#configure terminal 进入配置子模式

  Switch(config)#interface vlan 1 配置VLAN1

  Switch(config-if)#shutdown 关闭VLAN1

  Switch(config-if)#exit

  Switch(config)#exit

  Switch#show interface fastethernet0/1 status 查看F0/1网口状态

  Switch#show interface fastethernet0/1 查看F0/1网口详细配置

  Switch#show running-config 查看全局配置

  十一、配置默认网关:

  Switch#configure terminal 进入配置子模式

  Switch(config)#ip default-gateway 133.37.125.4

  Switch(config)#exit

  十二、设置使可以远程telnet登陆:

  Switch#configure terminal 进入配置子模式

  Switch(config)#line vty 0 4

  Switch(config-line)#password cisco

  Switch(config-line)#login

  Switch(config-line)#exit

  Switch(config)#exit

  十三、保存当前配置:

  Switch#copy running-config startup-config

  Destination filename [startup-config]?回车

  片刻后出现:

  Building configuration...

  [OK]

  表示当前配置保存成功。

  十四、交换机配置情况图示:

  配置完成,目前整个交换机配置情况如下:

  十五、其它相关知识:

  1、交换机与交换机/路由器间级联通信:

  当级联的设备端口设置了trunk或划分了VLAN等情况,可能需要修改级联端口的工作模式为trunk模式才能实现相互之间的通信。

  如果是与电口级联,可以修改1号网口为trunk工作模式,使用该接口进行级联:

  Switch#configure terminal 进入配置子模式

  Switch(config)#interface fastethernet0/1 进入F0/1口

  Switch(config-if)#switchport trunk encapsulation dot1q

  Switch(config-if)#switchport mode trunk 设成TRUNK口

  Switch(config-if)#switchport trunk allowed vlan all 允许所有VLAN从此口通过

  Switch(config-if)#exit

  Switch(config)#exit

  2、如果是与光纤接口级联,可以修改1号光纤接口为trunk工作模式,使用该接口进行级联:

  Switch#configure terminal 进入配置子模式

  Switch(config)#interface GigabitEthernet 0/1 进入G0/1

  Switch(config-if)#switchport trunk encapsulation dot1q

  Switch(config-if)#switchport mode trunk 设成TRUNK口

  Switch(config-if)#switchport trunk allowed vlan all 允许所有VLAN从此口通过

  Switch(config-if)#exit

  Switch(config)#exit

  执行后请按照第13步中的描述保存当前配置。

  3、WEB方式检查交换机状态:

  如果需要对交换机的状态进行实施查看,可以通过URL:https://192.168.1.5 或 https://133.37.125.5

  账号:admin

  密码:cisco

  登陆后进行查看。

  4、恢复交换机出厂设置:

  Switch>en 进入特权模式

  Switch#write erase

  Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]回车

  [OK]

  Erase of nvram: complete

  00:36:19: %SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram

  Switch# reload

  Proceed with reload? [confirm]回车

  00:36:59: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.

  片刻之后,交换机会进行重启,并在重启后恢复为出厂设置。

  5、远程通过telnet登陆交换机终端:

  将本机IP设置为与交换机VLAN2或VLAN3同一个网段;

  开始 → 运行 → cmd;

  执行telnet 133.37.125.5 或 telnet 192.168.1.5 即可。

  以上便是关于思科交换机配置的一些命令,对于只需要配置一整栋民居或网吧电脑的用户而言已经足够用了。

相关推荐
最新软件
最新教程
1.5067
基本信息
SQL
$_GET
$_POST
$_COOKIE
包含文件
自动加载
  1. 模型: /www/wwwroot/www.pjwan.com/lecms/model/
  2. 视图: /www/wwwroot/www.pjwan.com/view/m/xt_show.htm
  3. 控制器: /www/wwwroot/www.pjwan.com/lecms/control/show_control.class.php
  4. 日志目录: /www/wwwroot/www.pjwan.com/log/
  5. 当前页面: /www/wwwroot/www.pjwan.com/index.php
  6. 当前时间: 2026-08-20 09:40:29
  7. 当前网协: 216.73.216.186
  8. 请求路径: /anzhuang/22218.html
  9. 运行时间: 1.5067
  10. 内存开销: 1.1 MB
  1. #0 [time:0.0003s] SELECT * FROM le_runtime WHERE k='cfg' LIMIT 1
  2. #1 [time:0.0002s] SELECT * FROM le_runtime WHERE k='website_group_m_pjwan_com' LIMIT 1
  3. #2 [time:0.0004s] SELECT id FROM le_website_group WHERE webdomain='m.pjwan.com' AND is_active=1 ORDER BY id ASC LIMIT 0,1
  4. #3 [time:0.0004s] SELECT id FROM le_website_group WHERE webdomain='m.pjwan.com' AND is_active=1 ORDER BY id ASC LIMIT 0,1
  5. #4 [time:0.0003s] SELECT id FROM le_website_group WHERE webdomain='m.pjwan.com' AND is_active=1 ORDER BY id ASC LIMIT 0,1
  6. #5 [time:0.0003s] SELECT * FROM le_runtime WHERE k='cate_68' LIMIT 1
  7. #6 [time:0.0002s] SELECT id FROM le_website_group WHERE webdomain='m.pjwan.com' AND is_active=1 ORDER BY id ASC LIMIT 0,1
  8. #7 [time:0.0004s] SELECT * FROM le_cms_article WHERE id=22218 LIMIT 1
  9. #8 [time:0.0002s] SELECT id FROM le_website_group WHERE webdomain='m.pjwan.com' AND is_active=1 ORDER BY id ASC LIMIT 0,1
  10. #9 [time:0.0003s] SELECT id FROM le_website_group WHERE webdomain='m.pjwan.com' AND is_active=1 ORDER BY id ASC LIMIT 0,1
  11. #10 [time:0.0003s] SELECT * FROM le_user WHERE uid=2 LIMIT 1
  12. #11 [time:0.0005s] SELECT * FROM le_cms_article_data WHERE id=22218 LIMIT 1
  13. #12 [time:0.0004s] SELECT * FROM le_cms_article_views WHERE id=22218 LIMIT 1
  14. #13 [time:0.0003s] UPDATE LOW_PRIORITY le_cms_article_views SET views=views+1 WHERE id=22218 LIMIT 1
  15. #14 [time:0.0003s] SELECT * FROM le_kv WHERE k='navigate' LIMIT 1
  16. #15 [time:0.0002s] SELECT * FROM le_kv WHERE k='le_sharejs' LIMIT 1
  17. #16 [time:0.0006s] SELECT tagid,id FROM le_cms_article_tag_data WHERE tagid=3424 ORDER BY id DESC LIMIT 0,6
  18. #17 [time:0.0004s] SELECT * FROM le_cms_article_tag_data WHERE tagid=3424 AND id=58885 OR tagid=3424 AND id=57285 OR tagid=3424 AND id=54307 OR tagid=3424 AND id=34780 OR tagid=3424 AND id=25079 OR tagid=3424 AND id=22218
  19. #18 [time:0.0006s] SELECT * FROM le_cms_article WHERE id=58885 OR id=57285 OR id=54307 OR id=34780 OR id=25079
  20. #19 [time:0.0003s] SELECT * FROM le_runtime WHERE k='cate_1' LIMIT 1
  21. #20 [time:0.0003s] SELECT id FROM le_website_group WHERE webdomain='m.pjwan.com' AND is_active=1 ORDER BY id ASC LIMIT 0,1
  22. #21 [time:0.0007s] SELECT id FROM le_cms_pcsoft WHERE (cid=3 OR cid=4 OR cid=5 OR cid=6 OR cid=7 OR cid=8 OR cid=9 OR cid=10 OR cid=11 OR cid=12 OR cid=13) ORDER BY id DESC LIMIT 0,8
  23. #22 [time:0.0007s] SELECT * FROM le_cms_pcsoft WHERE id=681 OR id=680 OR id=679 OR id=678 OR id=677 OR id=676 OR id=675 OR id=674
  24. #23 [time:0.0003s] SELECT * FROM le_user WHERE uid=1 LIMIT 1
  25. #24 [time:0.0003s] SELECT id FROM le_cms_article WHERE cid=68 ORDER BY id DESC LIMIT 0,5
  26. #25 [time:0.0005s] SELECT * FROM le_cms_article WHERE id=79666 OR id=79665 OR id=79664 OR id=79663 OR id=79662
  1. #control => show
  2. #action => index
  3. #cid => 68
  4. #id => 22218
  5. #mid => 2
    1. #cdn_sec_tc => 0819529617871899710261399e81fcdc7afe267cb2c494c166a7cde449
    2. #PHPSESSID => tcifl4a1q82e13f7uvjs9pe49c
    3. #acw_tc => 0819529617871899710261399e81fcdc7afe267cb2c494c166a7cde449
    1. #0 /www/wwwroot/www.pjwan.com/index.php
    2. #1 /www/wwwroot/www.pjwan.com/lecms/xiunophp/xiunophp.php
    3. #2 /www/wwwroot/www.pjwan.com/lecms/config/config.inc.php
    4. #3 /www/wwwroot/www.pjwan.com/lecms/xiunophp/lib/base.func.php
    5. #4 /www/wwwroot/www.pjwan.com/lecms/xiunophp/lib/core.class.php
    6. #5 /www/wwwroot/www.pjwan.com/lecms/xiunophp/lib/debug.class.php
    7. #6 /www/wwwroot/www.pjwan.com/lecms/xiunophp/lib/log.class.php
    8. #7 /www/wwwroot/www.pjwan.com/lecms/xiunophp/lib/model.class.php
    9. #8 /www/wwwroot/www.pjwan.com/lecms/xiunophp/lib/view.class.php
    10. #9 /www/wwwroot/www.pjwan.com/lecms/xiunophp/lib/control.class.php
    11. #10 /www/wwwroot/www.pjwan.com/lecms/xiunophp/db/db.interface.php
    12. #11 /www/wwwroot/www.pjwan.com/lecms/xiunophp/db/db_pdo_mysql.class.php
    13. #12 /www/wwwroot/www.pjwan.com/lecms/xiunophp/cache/cache.interface.php
    14. #13 /www/wwwroot/www.pjwan.com/lecms/xiunophp/cache/cache_memcache.class.php
    15. #14 /www/wwwroot/www.pjwan.com/lecms/xiunophp/ext/network/Network__interface.php
    16. #15 /www/wwwroot/www.pjwan.com/lecms/config/plugin.inc.php
    17. #16 /www/wwwroot/www.pjwan.com/lecms/plugin/editor_sd/conf.php
    18. #17 /www/wwwroot/www.pjwan.com/lecms/plugin/editor_tinymce/conf.php
    19. #18 /www/wwwroot/www.pjwan.com/lecms/plugin/editor_um/conf.php
    20. #19 /www/wwwroot/www.pjwan.com/lecms/plugin/le_adminer/conf.php
    21. #20 /www/wwwroot/www.pjwan.com/lecms/plugin/le_baidu_zz/conf.php
    22. #21 /www/wwwroot/www.pjwan.com/lecms/plugin/le_category_filter/conf.php
    23. #22 /www/wwwroot/www.pjwan.com/lecms/plugin/le_content_tag_url/conf.php
    24. #23 /www/wwwroot/www.pjwan.com/lecms/plugin/le_data_table_split/conf.php
    25. #24 /www/wwwroot/www.pjwan.com/lecms/plugin/le_drafts/conf.php
    26. #25 /www/wwwroot/www.pjwan.com/lecms/plugin/le_feedback/conf.php
    27. #26 /www/wwwroot/www.pjwan.com/lecms/plugin/le_homepage_feign/conf.php
    28. #27 /www/wwwroot/www.pjwan.com/lecms/plugin/le_html_cache/conf.php
    29. #28 /www/wwwroot/www.pjwan.com/lecms/plugin/le_links/conf.php
    30. #29 /www/wwwroot/www.pjwan.com/lecms/plugin/le_minganci_do/conf.php
    31. #30 /www/wwwroot/www.pjwan.com/lecms/plugin/le_rand404content/conf.php
    32. #31 /www/wwwroot/www.pjwan.com/lecms/plugin/le_rand_author/conf.php
    33. #32 /www/wwwroot/www.pjwan.com/lecms/plugin/le_rand_pic_cid/conf.php
    34. #33 /www/wwwroot/www.pjwan.com/lecms/plugin/le_sharejs/conf.php
    35. #34 /www/wwwroot/www.pjwan.com/lecms/plugin/le_slide/conf.php
    36. #35 /www/wwwroot/www.pjwan.com/lecms/plugin/le_special_pro/conf.php
    37. #36 /www/wwwroot/www.pjwan.com/lecms/plugin/le_spider/conf.php
    38. #37 /www/wwwroot/www.pjwan.com/lecms/plugin/le_super_sitemap/conf.php
    39. #38 /www/wwwroot/www.pjwan.com/lecms/plugin/le_title_pic/conf.php
    40. #39 /www/wwwroot/www.pjwan.com/lecms/plugin/le_use_del_id/conf.php
    41. #40 /www/wwwroot/www.pjwan.com/lecms/plugin/le_webp_oss/conf.php
    42. #41 /www/wwwroot/www.pjwan.com/lecms/plugin/le_website_group/conf.php
    43. #42 /www/wwwroot/www.pjwan.com/lecms/plugin/le_zhanqunsitemaps_pro_v303/conf.php
    44. #43 /www/wwwroot/www.pjwan.com/lecms/plugin/lu_huochetou/conf.php
    45. #44 /www/wwwroot/www.pjwan.com/lecms/plugin/models_filed/conf.php
    46. #45 /www/wwwroot/www.pjwan.com/lecms/plugin/qrcode/conf.php
    47. #46 /www/wwwroot/www.pjwan.com/lecms/plugin/sy_mobile/conf.php
    48. #47 /www/wwwroot/www.pjwan.com/runcache/misc.func.php
    49. #48 /www/wwwroot/www.pjwan.com/runcache/core_lang/zh-cn.php
    50. #49 /www/wwwroot/www.pjwan.com/runcache/lang/zh-cn.php
    51. #50 /www/wwwroot/www.pjwan.com/runcache/lecms_control/parseurl_control.class.php
    52. #51 /www/wwwroot/www.pjwan.com/runcache/lecms_model/runtime_model.class.php
    53. #52 /www/wwwroot/www.pjwan.com/runcache/lecms_model/website_group_model.class.php
    54. #53 /www/wwwroot/www.pjwan.com/runcache/lecms_control/show_control.class.php
    55. #54 /www/wwwroot/www.pjwan.com/runcache/lecms_control/base_control.class.php
    56. #55 /www/wwwroot/www.pjwan.com/runcache/lecms_model/urls_model.class.php
    57. #56 /www/wwwroot/www.pjwan.com/runcache/lecms_model/category_model.class.php
    58. #57 /www/wwwroot/www.pjwan.com/runcache/lecms_model/cms_content_model.class.php
    59. #58 /www/wwwroot/www.pjwan.com/runcache/lecms_view/m,xt_show.htm.php
    60. #59 /www/wwwroot/www.pjwan.com/runcache/lecms_model/cms_content_data_model.class.php
    61. #60 /www/wwwroot/www.pjwan.com/runcache/lecms_model/cms_content_tag_model.class.php
    62. #61 /www/wwwroot/www.pjwan.com/runcache/lecms_model/user_model.class.php
    63. #62 /www/wwwroot/www.pjwan.com/runcache/lecms_model/cms_content_views_model.class.php
    64. #63 /www/wwwroot/www.pjwan.com/runcache/lecms_model/kv_model.class.php
    65. #64 /www/wwwroot/www.pjwan.com/runcache/lecms_model/cms_content_tag_data_model.class.php
    66. #65 /www/wwwroot/www.pjwan.com/lecms/xiunophp/ext/utf8.class.php
    67. #66 /www/wwwroot/www.pjwan.com/lecms/xiunophp/tpl/sys_trace.php
    1. #0 utf8 类