




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、思思科科交交换换机机配配置置命命令令简简写写命命令令完完整整命命令令1用户模式:用户模式:switchswitch2特权模式:特权模式:switchenswitchenableswitch# switch# 3全局配置模式全局配置模式switch#conf tswitch#config terminalswitch(config)# switch(config)# 4接口配置模式接口配置模式switch(config)#in f0/1switch(config)#interface f0/1switch(config-if)#switch(config-if)#5line模式:line模式:s
2、witch(config)#lin c 0switch(config)#line console 0switch(config-line)#switch(config-line)#6更改交换机主机名更改交换机主机名switch(config)#ho benetswitch(config)#hostname benetbenet(config)#benet(config)#7配置进入特权模式的明文口令配置进入特权模式的明文口令switch(config)#en pass 123switch(config)#enable password 1238删除进入特权模式的明文口令删除进入特权模式的明文口
3、令switch(config)#no ena passswitch(config)#no enable password9配置进入特权模式的加密口令配置进入特权模式的加密口令switch(config)#en se 456switch(config)#enable secret 45610删除进入特权模式的加密口令删除进入特权模式的加密口令switch(config)#no ena seswitch(config)#no enable secret11查看交换机配置查看交换机配置switch#sh runswitch#show running-config12配置console口令配置cons
4、ole口令switch(config)#lin cons 0 switch(config)#line console 0switch(config-line)#pass 123switch(config-line)#password 123switch(config-line)#logiswitch(config-line)#login13配置交换机IP地址配置交换机IP地址switch(config)#in vl 1switch(config)#interface vlan 1switch(config-if)#ip ad switch(co
5、nfig-if)#ip address switch(config-if)#no shswitch(config-if)#no shutdown14删除交换机接口IP地址删除交换机接口IP地址switch(config-if)#no ip adswitch(config-if)#no ip address15配置交换机默认网关配置交换机默认网关switch(config)#ip default-g switch(config)#ip default-gateway 16查看交换机的MAC地址表查看交换
6、机的MAC地址表switch#sh mac-aswitch#show mac-address-table17查看思科交换机相邻设备的详细信息查看思科交换机相邻设备的详细信息switch#sh cdp nei deswitch#show cdp neighbors detail18保存交换机配置保存交换机配置1:switch#cop run st1:switch#copy running-config startup-config2:switch#wr2:switch#write19恢复交换机出厂配置恢复交换机出厂配置switch#er stswitch#erase startup-config
7、switch#reloswitch#reload20创建VLAN创建VLANswitch#vl daswitch#vlan databaseswitch(vlan)#vl 30switch(vlan)#vlan 30switch(vlan)#exitswitch(vlan)#exit21VLAN重命名VLAN重命名switch(vlan)#vl 20 n benetswitch(vlan)#vlan 20 name benetVLAN 20 modified:VLAN 20 modified: Name: benet Name: benet22删除VLAN删除VLANswitch(vlan)#
8、n vl 20switch(vlan)#no vlan 20Deleting VLAN 2.Deleting VLAN 2.switch(vlan)#eswitch(vlan)#exit简简写写命命令令完完整整命命令令23将端口加入到VLAN将端口加入到VLANswitch(config)#in f0/2switch(config)#interface f0/2switch(config-if)#sw a v 30switch(config-if)#switchport access vlan 3024验证VLAN配置信息验证VLAN配置信息switch#sh vlan bswitch#sho
9、w vlan briefswitch#sh vlan-sswitch#show vlan-switch25删除VLAN中的端口删除VLAN中的端口1:switch(config-if)#no sw a v 31:switch(config-if)#no switchport access vlan 3 switch(config-if)#end switch(config-if)#end2:switch(config-if)#def interface f0/22:switch(config-if)#default interface f0/2 Building configuration.
10、Building configuration. Interface FastEthernet0/2 set to default configuration Interface FastEthernet0/2 set to default configuration switch(config)#end switch(config)#end 26同时将多个端口加入VLAN并验证同时将多个端口加入VLAN并验证switch(config)#in r f0/3 - 10switch(config)#interface range f0/3 - 10 switch(config-if-range)#
11、sw a v 3switch(config-if-range)#switchport access vlan 3switch(config)#endswitch(config)#endswitch#sh vlan-sswitch#show vlan-switch27配置VLAN TRUHK配置VLAN TRUHKswitch(config)#in f0/15switch(config)#interface f0/15switch(config-if)#sw m tswitch(config-if)#switchport mode trunk28从TRUNK中添加某个VLAN从TRUNK中添加某
12、个VLANswitch(config)#in f0/15switch(config)#interface f0/15switch(config-if)#sw t a v ad 3switch(config-if)#switchport trunk allowed vlan add 3 switch(config-if)#endswitch(config-if)#end29从TRUNK中删除某个VLAN从TRUNK中删除某个VLANswitch(config)#in f0/15switch(config)#interface f0/15switch(config-if)#sw t a v r 3
13、switch(config-if)#switchport trunk allowed vlan remove 3 switch(config-if)#endswitch(config-if)#end30验证接口模式(检查中断端口允许的VLAN列表)验证接口模式(检查中断端口允许的VLAN列表)switch#sh int f0/15 switchp switch#show interface f0/15 switchport31查看用过的命令查看用过的命令switch#sh hiswitch#show history思思科科路路由由器器配配置置命命令令简简写写命命令令完完整整命命令令1用户模式:
14、RouterRouter2特权模式:RouterenRouterenableRouter# Router# 3全局配置模式Router#conf tRouter#config terminalRouter(config)# Router(config)# 4接口配置模式Router(config)#in f1/0Router(config)#interface f1/0Router(config-if)#Router(config-if)#5子接口配置模式Router(config)#in f1/0.1Router(config)#interface f1/0.1Router(config-s
15、ubif)#Router(config-subif)#6line模式:Router(config)#lin c 0Router(config)#line console 0Router(config-line)#Router(config-line)#7路由模式Router(config)#router rip(rip是一种路由协议)Router(config)#router rip(rip是一种路由协议)Router(config-router)#Router(config-router)#8静态路由的配置Routeren Routerenable Router#conf t Router#
16、config terminal Router(config)#in f0/0 Router(config)#interface f0/0 Router(config-if)#ip ad Router(config-if)#ip address Router(config-if)#no shRouter(config-if)#no shutdown Router(config-if)#e Router(config-if)#exit Router(config)#ip route 目标网段 目
17、标网段掩码 下一跳入口IP地址Router(config)#ip route 目标网段 目标网段掩码 下一跳入口IP地址9默认路由的配置Router(config)#ip route 下一跳入口IP地址Router(config)#ip route 下一跳入口IP地址10查看路由表benet#sh ip robenet#show ip route11更改路由器主机名Router(config)#ho zscRouter(config)#hostname zsczsc(config)#zsc(config)#12查看接口状态Rout
18、er#sh int f0/0Router#show interfaces f0/013查看路由器当前时间Router#sh cloRouter#show clock14配置路由器接口IP地址Router(config)#in f1/0 (有些写成e0/1,e0)Router(config)#interface f1/0 (有些写成e0/1,e0)Router(config-if)#ip ad 0 Router(config-if)#ip address 0 Router(config-if)#no shRouter(c
19、onfig-if)#no shutdown15配置控制台密码Router(config)#lin c 0Router(config)#line console 0Router(config-line)#pas 123Router(config-line)#password 123Router(config-line)#logiRouter(config-line)#login16配置特权模式密码Router(config)#ena p 123Router(config)#enable password 12317配置加密保存的密码Router(config)#ena s 321Router(c
20、onfig)#enable secret 32118对所有密码加密Router(config)#ser pasRouter(config)#service password-encryption19配置接口标识Router(config-if)#des this is zsc!Router(config-if)#description this is zsc!20配置路由器banner提示信息Router(config)#ban m $this is a main router$Router(config)#banner motd $this is a main router$21配置超时Ro
21、uter(config)#lin c 0Router(config)#line console 0Router(config-line)#exec-t 0 0Router(config-line)#exec-timeout 0 022显示同步Router(config)#lin c 0Router(config)#line console 0Router(config-line)#logg sRouter(config-line)#logging synchronous23禁用DNSRouter(config)#no ip domain-loRouter(config)#no ip domai
22、n-lookup24查看路由器版本信息Router#sh veRouter#show version25配置路由器和交换机间的单臂路由Router(config)#in f0/0.1 (进入子接口模式)Router(config)#in f0/0.1 (进入子接口模式)Router(config-subif)#en d 20 (封装802.1Q协议)Router(config-subif)#encapsulation dot1Q 20 (封装802.1Q协议)Router(config-subif)#ip ad Router(config-su
23、bif)#ip address Router(config-subif)#no shRouter(config-subif)#no shutdown26配置RIP V1动态路由协议 Router(config)#router rRouter(config)#router ripRouter(config-router)#net Router(config-router)#network Router(config-router)#net Router(config-router)#netwo
24、rk 27删除RIP V1动态路由协议 Router(config)#no router rRouter(config)#no router rip28配置RIP V2动态路由协议 Router(config)#router rRouter(config)#router ripRouter(config-router)#ve 2Router(config-router)#version 2Router(config-router)#no auRouter(config-router)#no auto-summaryRouter(config-router)#net 10.
25、1.1.0Router(config-router)#network Router(config-router)#net Router(config-router)#network 29查看路由表Router#sh ip roRouter#show ip route30查看路由协议配置Router#sh ip proRouter#show ip protocol31打开RIP协议调试命令Router#deb ip riRouter#debug ip rip32查看交换机或路由器中的flash信息Router#sh flaRouter#
26、show flash33设置VTY(虚拟终端接口)密码Router(config)#lin v 0 1Router(config)#line vty 0 1Router(config-line)#logiRouter(config-line)#loginRouter(config-line)#pas 123Router(config-line)#password 12334下载路由器中的IOSRouter#copy flash:flash文件名 tftp35上传IOS到路由器Router#copy tftp:ios文件名 flash36下载路由器中的配置文件Router#copy nvram:
27、文件名 tftp37上传配置文件到路由器Router#copy tftp:startup-config.cfg nvram38保存配置到NVRAMRouter# copy running-config startupconfigRouter# copy run start或者cop ru st保存配置到NVRAMRouter# writeRouter# wr40删除配置erase startup-configerase start/era st宣告启用RIP的接口的主网络号宣告启用RIP的接口的主网络号宣告启用RIP的接口的主网络号宣告启用RIP的接口的主网络号19使用Telnet管理Cisc
28、o设备1:设置路由器上的管理接口IP地址和电脑IP地址,使二者处于同网段.2:设置VTY(虚拟终端线接口)密码Router(config)#line vty 0 1Router(config-line)#loginRouter(config-line)#passwor 1233:设置enable密码Router(config)#enable password 4564:运行CISCO TFTP SERVER软件,设置IOS文件存储位置5:运行CMD命令telnet 23(23是端口号)6:输入VTY密码进入用户模式7:输入enable密码进入特权模式8:查看flash中
29、IOS文件相关信息Router#show flash9:下载IOS文件(或上传IOS,下载配置文件,上传配置文件等)Router#copy flash:flash文件名 tftp(下载路由中的IOS)Router#copy tftp:ios文件名 flash(上传IOS到路由器)Router#copy nvram:文件名 tftp(下载配置文件)Router#copy tftp:startup-config.cfg nvram(上传配置文件)2950交换机密码恢复一:保留相关配置文件,只需要清除密码.原理:因为密码保存在config.text中,所以可以使交换机在启动时绕过config.tex
30、t配置,然后重新配置密码即可.步骤:1:拔掉交换机电源线2:用手按住交换机的mode键,并插上电源线3:当交换机出现system software flash_init等信息界面时松开mode键4:在switch:后执行flash_init命令(switch:flash_init)5:查看flash中的文件(switch:dir flash)6:把config.text文件改名为config.old文件(switch:rename flash:config.text flash:config.old)7:执行boot命令,启动交换机(switch:boot)8:进入特权模式查看flash文件(switch#dir flash)9:把config.old文件改名为config.text文件(switch#rename flash:config.old flash:config.text)10:把config.text复制为系统的running-config(switch#copy flash:config.text running-config)11:进入相应配置模式重新设置密码并储存,至此密码恢复完成.二:清除密码,同时交换机的配置文件也丢失.(1) 拔下交换机的电源线.(2) 用手按住交换机的MODE按键上,插上电源线(3) 看到控
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 开拓新思维的工作计划
- 2025届甘肃省庆阳市宁县数学七下期末经典模拟试题含解析
- 水务能源节约利用方案计划
- 电子商务行业保安措施总结计划
- 财务数据安全管理策略计划
- 2024年中山市坦洲人民医院招聘笔试真题
- 2024年宁夏师范学院辅导员考试真题
- 2024年南京医科大学辅导员考试真题
- 软件开发能力考核策划试题及答案
- 2024年湖北省广播电视局下属事业单位真题
- 食堂库存物的盘点表
- 单位闲置房屋盘活方案范本
- 美妙的高等数学(上)智慧树知到课后章节答案2023年下江西师范大学
- 新员工入职报到通知书
- 2018年版电工-国家职业技能标准
- 浅谈如何做好财务安全工作
- 电动车分期付款的合同范本
- 高中英语-Live form the Louvre教学设计学情分析教材分析课后反思
- 2023北京高考英语答题卡ok
- 医务科运用PDCA循环提高门诊医生准时出诊率PDCA成果汇报
- 动脉采血操作考核标准
评论
0/150
提交评论