2022年cisco路由器交换机配置命令大全 .pdf

上传人:Che****ry 文档编号:27252939 上传时间:2022-07-23 格式:PDF 页数:17 大小:98.50KB
返回 下载 相关 举报
2022年cisco路由器交换机配置命令大全 .pdf_第1页
第1页 / 共17页
2022年cisco路由器交换机配置命令大全 .pdf_第2页
第2页 / 共17页
点击查看更多>>
资源描述

《2022年cisco路由器交换机配置命令大全 .pdf》由会员分享,可在线阅读,更多相关《2022年cisco路由器交换机配置命令大全 .pdf(17页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、路 由 /交 换 机 命 令 大 全 ! 交换机命令switch 用户模式1:进入特权模式enable switch enable switch# 2:进入全局配置模式configure terminal switch enable switch c onfigure terminal switch(conf)# 3:交换机命名hostname aptech2950 以 aptech2950 为例switch enable switch c onfigure terminal switch(conf)#hostname aptch-2950 aptech2950(conf)# 4:配置使能口令

2、enable password cisco 以 cisco 为例switch enable 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 17 页 - - - - - - - - - switch c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable password cisco 5: 配置使能密码enable secret ciscolab 以 cicsolab 为例s

3、witch enable switch c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable secret ciscolab 6:设置虚拟局域网vlan 1 interface vlan 1 switch enable switch c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface vlan 1 aptech2950(conf-if)#ip address 192.168.1.1 255

4、.255.255.0 配置交换机端口 ip 和子网掩码aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exit aptech2950(conf)#ip default-gateway 192.168.254 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 17 页 - - - - - - - - - 设置网关地址7:进入交换机某一端口interface fastehernet 0/17 以17端口为例swit

5、ch enable switch c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface fastehernet 0/17 aptech2950(conf-if)# 8:查看命令show switch enable switch# show version 察看系统中的所有版本信息show interface vlan 1 查看交换机有关ip 协议的配置信息show running-configure 查看交换机当前起作用的配置信息show interface fastethernet 0/

6、1 察看交换机 1接口具体配置和统计信息show mac-address-table 查看 mac 地址表show mac-address-table aging-time 查看 mac 地址表自动老化时间9:交换机恢复出厂默认恢复命令名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 17 页 - - - - - - - - - switch enable switch# erase startup-configure switch# reload 10:双工模式设置swi

7、tch enable switch c onfigure terminal switch2950(conf)#hostname aptch-2950 aptech2950(conf)# interface fastehernet 0/17 以17端口为例aptech2950(conf-if)#duplex full/half/auto 有 full , half, auto 三个可选项11:cdp 相关命令switch enable switch# show cdp 查看设备的 cdp 全局配置信息show cdp interface fastethernet 0/17 查看17端口的 cdp

8、 配置信息show cdp traffic 查看有关 cdp 包的统计信息show cdp nerghbors 列出与设备相连的cisco 设备名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 17 页 - - - - - - - - - 12:csico2950 的密码恢复拔下交换机电源线。用手按着交换机的MODE 键,插上电源线在 switch:后执行 flash_ini 命令: switch: flash_ini 查看 flash 中的文件:switch: dir f

9、lash: 把“ config.text ” 文件改名为 “ config.old ”: switch: rename flash: config.text flash: config.old 执行 boot:switch: boot 交换机进入是否进入配置的对话,执行no :进入特权模式察看flash 里的文件:show flash : 把“ config.old ” 文件改名为“ config.text ”:switch: rename flash: config.old flash: config.text 把“ config.text ” 拷入系统的 “ running-configu

10、re ”: copy flash: config.text system : running-configure 把配置模式重新设置密码存盘,密码恢复成功。13:交换机 telnet 远程登录设置:switchen switch c onfigure terminal switch(conf)#hostname aptech-2950 aptech2950(conf)#enable password cisco 以 cisco名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共

11、 17 页 - - - - - - - - - 为特权模式密码aptech2950(conf)#interface fastethernet 0/1 以17端口为 telnet 远程登录端口aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 aptech2950(conf-if)#no shut aptech2950(conf-if)#exit aptech2950(conf)line vty 0 4 设置0-4 个用户可以 telnet 远程登陆aptech2950(conf-line)#login aptech2950(conf

12、-line)#password edge 以 edge 为远程登录的用户密码主机设置:ip 192.168.1.2 主机的 ip 必须和交换机端口的地址在同一网络段netmask 255.255.255.0 gate-way 192.168.1.1 网关地址是交换机端口地址运行:telnet 192.168.1.1 进入 telnet 远程登录界面password : edge aptech2950en 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 17 页 - - -

13、 - - - - - - password: cisco aptech# 14:交换机配置的重新载入和保存设置完成交换机的配置后:aptech2950(conf)#reload 是否保存( y/n)y: 保存设置信息n:不保存设置信息路由器命令router 用户模式1:进入特权模式enable router enable router # 2:进入全局配置模式configure terminal router enable router c onfigure terminal router (conf)# 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - -

14、 - - - - - - 名师精心整理 - - - - - - - 第 7 页,共 17 页 - - - - - - - - - 3:交换机命名hostname routera 以 routerA 为例router enable router c onfigure terminal router(conf)#hostname routerA routera (conf)# 4:配置使能口令enable password cisco 以 cisco 为例router enable router c onfigure terminal router(conf)#hostname routerA r

15、outerA (conf)# enable password cisco 5: 配置使能密码enable secret ciscolab 以 cicsolab 为例router enable router c onfigure terminal router(conf)#hostname routerA routerA (conf)# enable secret ciscolab 6:进入路由器某一端口interface fastehernet 0/17 以17端口为例router enable 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - -

16、- - - - 名师精心整理 - - - - - - - 第 8 页,共 17 页 - - - - - - - - - router c onfigure terminal router(conf)#hostname routerA routerA (conf)# interface fastehernet 0/17 routerA (conf-if)# 进入路由器的某一子端口interface fastethernet 0/17.1 以17端口的1子端口为例router enable router c onfigure terminal router(conf)#hostname route

17、rA routerA (conf)# interface fastehernet 0/17.1 7:设置端口 ip 地址信息router enable router c onfigure terminal router(conf)#hostname routerA routerA(conf)# interface fastehernet 0/17 以17端口为例routerA (conf-if)#ip address 192.168.1.1 255.255.255.0 配置交换机端口 ip 和子网掩码routerA (conf-if)#no shut 是配置处于运行中routerA (conf

18、-if)#exit 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 9 页,共 17 页 - - - - - - - - - 8:查看命令show router enable router # show version 察看系统中的所有版本信息show interface vlan 1 查看交换机有关ip 协议的配置信息show running-configure 查看交换机当前起作用的配置信息show interface fastethernet 0/1 察看交换机 1接口具体配置

19、和统计信息show mac-address-table 查看 mac 地址表show mac-address-table aging-time 查看 mac 地址表自动老化时间show controllers serial + 编号查看串口类型show ip router 查看路由器的路由表9:cdp 相关命令router enable router # show cdp 查看设备的 cdp 全局配置信息show cdp interface fastethernet 0/17 查看17端口的 cdp 配置信息show cdp traffic 查看有关 cdp 包的统计信息show cdp ne

20、rghbors 列出与设备相连的cisco 设备名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 10 页,共 17 页 - - - - - - - - - 10:csico2600 的密码恢复重新启动路由器,在启动过程中按下win+break 键,使路由器进入rom monitor 在提示符下输入命令修改配置寄存器的值,然后重新启动路由器remmon1confreg 0 x2142 remmon2reset 重新启动路由器后进入setup 模式,选择“ no”,退回到 exec 模式

21、,此时路由器原有的配置仍然保存在startup-config 中,为使路由器恢复密码后配置不变把startup-config 中配置保存到 running-config中,然后重新设置 enable 密码,并把配置寄存器改回0 x2102 :routerenable router#copy startup-config running-config routerc onfigure terminal router(conf)#enable password cisco router(conf) c onfig-register 0 x2102 保存当前配置到 startup-config ,

22、重新启动路由器。router #copy running-config startup-config router #reload 11:路由器 telnet 远程登录设置:routeren router c onfigure terminal 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 11 页,共 17 页 - - - - - - - - - router (conf)#hostname routerA routerA (conf)#enable password cisco

23、 以 cisco 为特权模式密码routerA (conf)#interface fastethernet 0/1 以17端口为 telnet 远程登录端口routerA (conf-if)#ip address 192.168.1.1 255.255.255.0 routerA (conf-if)#no shut routerA (conf-if)#exit routerA (conf)line vty 0 4 设置0-4 个用户可以 telnet 远程登陆routerA (conf-line)#login routerA (conf-line)#password edge 以 edge 为

24、远程登录的用户密码主机设置:ip 192.168.1.2 主机的 ip 必须和交换机端口的地址在同一网络段netmask 255.255.255.0 gate-way 192.168.1.1 网关地址是交换机端口地址运行:telnet 192.168.1.1 进入 telnet 远程登录界面名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 12 页,共 17 页 - - - - - - - - - password : edge routeraen password: cisco ro

25、utera# 12:配置路由器的标识banner $ $ 在全局配置的模式下利用“ banner ” 命令可以配置路由器的提示信息,所有连接到路由器的终端都会收到。routeren router c onfigure terminal router (conf)#hostname routerA routerA(conf)#banner motd $This is aptech company router ! Please don t change the configuration without permission!$ 13:配置接口标识description 接口标识用于区分路由器的

26、各个接口。routeren router c onfigure terminal router (conf)#hostname routerA routerA(conf)#interface fastethernet 0/1 以0/1 接口为例routerA(conf-if)# description this is a fast Ethernet port used toconnecting the company s intranet! 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - -

27、 第 13 页,共 17 页 - - - - - - - - - 14:配置超时超时适用于设置在多长时间没有对console 进行配置,自动返回 exec 会话时间。默认为 10分钟。routeren router c onfigure terminal router (conf)#hostname routerA routerA(conf)#line console 0 routerA(conf-if) e xec-timeout 0 0 第一个 “ 0” 代表分钟,第二个 “ 0” 代表秒15:配置串口参数两台路由器通过串口连接需要一个做为DTE,一个做为 DCE。DCE设备要向 DTE

28、设备提供时钟频率和带宽。DCE 配置:routeren router c onfigure terminal router (conf)#hostname routerA routerA(conf)#interface serial 0/0 routerA(conf_if)#clock rate 64000 提供时钟频率为64000 routerA(conf_if)#bandwidth 64 提供带宽为 64 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 14 页,共 17 页 -

29、 - - - - - - - - DTE 配置:路由器串口配置ip 地址routeren router c onfigure terminal router (conf)#hostname routerB routerB(conf)#interface serial 0/0 routerB(conf_if)#ip address 192.168.1.1 255.255.255.0 16:静态路由的配置配置路由器 A 的主机名和接口参数routerenable routerc onfigure terminal router(conf)#hostname routerA routerA(conf

30、)#interface fastethernet 0/1 路由器A的1端口为两路由器的连接端口routerA(conf-if)#ip address 192.168.2.1 255.255.255.0 routerA(conf-if)#no shutdown routerA(conf-if)#exit routerA(conf)# interface fastethernet 0/0 路由器A的0端口为与主机的连接端口routerA(conf-if)#ip address 192.168.1.2 255.255.255.0 routerA(conf-if)#no shutdown 主机 A 的

31、 ip 地址为 192.168.1.1 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 15 页,共 17 页 - - - - - - - - - 255.255.255.0 192.168.1.2 配置路由器 B 的主机名和接口参数routerenable routerc onfigure terminal router(conf)#hostname routerB routerB(conf)#interface fastethernet 0/0 路由器B的0端口为两路由器的连接端

32、口routerB(conf-if)#ip address 192.168.2.2 255.255.255.0 routerB(conf-if)#no shutdown routerB (conf-if)#exit routerB(conf)# interface fastethernet 0/1 路由器B的1端口为与主机的连接端口routerB(conf-if)#ip address 192.168.3.1 255.255.255.0 主机 B 的 ip 地址为 192.168.3.2 255.255.255.0 192.168.3.1 配置路由器 A 的静态路由表routerA(conf)#

33、ip router 192.168.3.0 255.255.255.0 192.168.2.2 配置路由器 B 的静态路由表名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 16 页,共 17 页 - - - - - - - - - routerA(conf)#ip router 192.168.1.0 255.255.255.0 192.168.2.1 在 routerA 和 routerB 上配置默认路由routerA(conf)#ip route 0.0.0.0 0.0.0.0

34、192.168.2.2 routerA(conf)#ip classless routerB(conf)#ip route 0.0.0.0 0.0.0.0 192.168.2.1 routerB(conf)#ip classless 在 routerA 和 routerB 上配置动态路由 (RIP) routerA(conf)#router rip routerA(conf)#network 192.168.1.0 routerA(conf)#network 192.168.2.0 routerB(conf)# router rip routerB(conf)#network 192.168.2.0 routerB(conf)#network 192.168.3.0名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 17 页,共 17 页 - - - - - - - - -

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 高考资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com