已阅读5页,还剩6页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Cisco交换机配置命令首先通过配置线连接电脑与交换机的console口,在电脑上按以下步骤打开超级终端连接交换机: 开始-程序-附件-通讯-超级终端 连接选择COM口选择还原默认值,按确定,即可与交换机交互 一. 基本配置进入特权模式:Switch en Switch#进入全局模式:Switch# config terminalSwitch(Config)#退出命令 exit举例: Switch#exit Switch时钟配置clock set 功能:设置系统日期和时钟。 参数:为当前时钟,HH 取值范围为023,MM 和SS 取值范围为059;为当前年、月和日,YYYY 取值范围为20002035,MM 取值范围为112,DD 取值范围为131。举例:设置交换机当前日期为2002年 8月 1日 23时 0分 0秒。Switch# clock set 23:0:0 2002.8.1超时设置exec-timeout 功能:设置退出特权用户配置模式超时时间。 参数:为时间值,单位为分钟,取值范围为0300。 缺省情况:系统缺省为5分钟。 使用指南:为确保交换机使用的安全性,防止非法用户的恶意操作,当特权用户在做完最后一项配置后,开始计时,到达设置时间值时,系统就自动退出特权用户配置模式。数值为0表示没有超时。举例:设置交换机退出特权用户配置模式的超时时间为6分钟。 Switch(Config)# line console 0Switch(config-line)# exec-timeout 0 0 - 0为不超时修改交换机的主机名 hostname XXX举例:设置提示符为Test。 Switch(Config)#hostname Test Test(config)#加密明文加密:: Test(config)# enable password XXX密文加密:: Test(config)# enable secret XXX举例:设置密码为1111test(config)#enable password 111test(config)#exittest#exittestenPassword: - 输入密码 1111test#恢复交换机出厂配置命令:erase startup-config重启交换机的命令:reload保存交换机配置的命令:write举例: Switch#erase startup-config Switch#reloadSwitch#write 二查看命令显示ARP映射表命令show arp 命令模式:特权用户配置模式。 使用指南:显示当前 ARP 映射表的内容,如:IP 地址,硬件地址,硬件类型,接口名等。 举例: Switch# show arp Total arp items is 2, the matched arp items is 2 Address Hardware Addr Interface Port Flag 1.1.1.2 00-01-7A-43-65-73 Vlan1 Ethernet0/0/23 Dynamic 192.168.1.145 00-01-7A-FE-38-8A Vlan1 Ethernet0/0/23 Dynamic查看MAC地址表命令: show mac-address-table Dynamic - dynamic entry type interfaces - interface entry type static - static entry type 命令模式:特权用户配置模式 使用指南:本命令可以分类显示各种 MAC 地址表项,也可以使用命令 show mac-address-table 显示当前交换机内所有的MAC地址表项。 举例:显示当前MAC地址表中的动态表项。 Switch#show mac-address-table dynamic Mac Address Table-Vlan Mac Address Type Ports- - - - 1 0060.5c5b.0608 DYNAMIC Fa0/8查看交换机当前配置命令show running-config 举例: test# show running-config 可简写为test# show runBuilding configuration.Current configuration : 1048 bytes!version 12.2no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname test!enable password 1111!interface FastEthernet0/1查看端口命令show ip interface briefshow interface 举例:显示全部接口的状态。test# show ip interface briefInterface IP-Address OK? Method Status Protocol FastEthernet0/1 unassigned YES manual down down FastEthernet0/2 unassigned YES manual up up FastEthernet0/3 unassigned YES manual down down FastEthernet0/4 unassigned YES manual down down FastEthernet0/5 unassigned YES manual up up FastEthernet0/6 unassigned YES manual down down FastEthernet0/7 unassigned YES manual down down FastEthernet0/8 unassigned YES manual up up举例:显示端口0/0/1的信息。 Test#show int fastEthernet 0/1FastEthernet0/1 is down, line protocol is down (disabled) Hardware is Lance, address is 00d0.ffa5.0c01 (bia 00d0.ffa5.0c01) BW 100000 Kbit, DLY 1000 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Half-duplex, 100Mb/s input flow-control is off, output flow-control is off ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:08, output 00:00:05, output hang never Last clearing of show interface counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo Output queue :0/40 (size/max) 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 956 packets input, 193351 bytes, 0 no buffer Received 956 broadcasts, 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 0 watchdog, 0 multicast, 0 pause input 0 input packets with dribble condition detected 2357 packets output, 263570 bytes, 0 underruns跟踪路由命令traceroute | host 功能:本命令用于测试数据包从发送设备到目的地设备所经过的网关,检测网络是否可达,定位网络故障所在。 参数:是目的主机的 IP 地址,点分十进制格式;是为远端主机的主机名; 命令模式:特权用户配置模式。 使用指南:Traceroute一般用于定位目的网络不可达时的故障所在。举例:Switch# traceroute 192.168.2.3三. telnet管理交换机设置管理VLANtest# config test(config)#int vlan 1test(config-if)#ip add 192.168.1.1 255.255.255.0test(config-if)#no shut设置telnet的线路test(config)#line vty 0 4test(config-line)#password ciscotest(config-line)#login注意:必须要设特权模式的密码才能登录交换机test(config)# enable password 1111在计算机上配置与管理IP相同网段的IP地址,在运行那里输入telnet 192.168.1.1在 Telnet 配置界面上输入正确的口令,Telnet 用户就可成功登录到交换机,再通过特权模式密码1111就能进入进入到交换机的 CLI 配置界面,Telnet 登录后与通过 Console 口进入后使用的命令完全一致。四. 交换机端口配置进入端口配置模式test(config)#int fastEthernet 0/1test(config-if)#关闭和打开端口test(config-if)#shutdown test(config-if)#no shutdown设置端口速率和双工test(config)# int fastEthernet 0/8test(config-if)# speed ? - 设置速率 10 Force 10 Mbps operation 100 Force 100 Mbps operation auto Enable AUTO speed configurationtest(config-if)#duplex ? - 设置双工模式 auto Enable AUTO duplex configuration full Force full duplex operation half Force half-duplex operation设定端口描述:description 命令模式:端口配置模式。 举例:设定端口fastEthernet 0/8的描述为trunktest(config)#int fastEthernet 0/8test(config-if)#description trunktest#show runBuilding configuration.Current configuration : 1096 bytes!msecno service timestamps debug datetime msechostname test!enable password 1111!interface FastEthernet0/1!interface FastEthernet0/2!interface FastEthernet0/3!interface FastEthernet0/4!interface FastEthernet0/5!interface FastEthernet0/6!interface FastEthernet0/7!interface FastEthernet0/8 description trunk!五. 配置VLAN创建vlan vlan 命令模式:全局配置模式。 缺省情况:交换机缺省只有VLAN1。 使用指南:VLAN1 为交换机的缺省 VLAN,用户不能配置和删除 VLAN1。允许配置VLAN的总共数量为4094个。 举例:创建VLAN100,并且进入VLAN100 的配置模式。 test(Config)#vlan 100 test(Config-Vlan100)#删除vlan100test(Config)# no vlan 100 命名vlanname 命令模式:VLAN配置模式。 缺省情况:VLAN缺省VLAN名称为vlanXXX,其中XXX为 VID。 使用指南:交换机提供为不同的VLAN指定名称的功能,有助于用户记忆VLAN,方便管理。 举例:为VLAN100指定名称为TestVlan。 test(Config-Vlan100)#name TestVlan将某个端口加入指定vlan命令:switchport access vlan no switchport access vlan 功能: 将当前Access端口加入到指定VLAN; 本命令no操作为将当前端口从VLAN里删除。 参数:为当前端口要加入的vlan VID,取值范围为14094。 命令模式:接口配置模式 缺省情况:所有端口默认属于VLAN1。 使用指南: 只有属于Access mode 的端口才能加入到指定的VLAN中, 并且Access端口同时只能加入到一个VLAN里去。 举例:设置fastEthernet 0/2端口为Access端口并加入VLAN2。 test(config)# int fastEthernet 0/2test(config-if)# switchport mode access test(config-if)# switchport access vlan 2举例:设置fastEthernet 0/5-7端口为Access端口并加入VLAN100test(config)#int range fastEthernet 0/5-7test(config-if-range)# switchport mode accesstest(config-if-range)# switchport access vlan 100更改端口的vlan-id举例:将fastEthernet 0/7端口改为VLAN2。test(config)#int fa0/7test(config-if)# switchport access vlan 2设置端口的vlan模式test(config-if)#switchport mode ? access Set trunking mode to ACCESS unconditionally dynamic Set trunking mode to dynamically negotiate access or trunk mode trunk Set trunking mode to TRUNK unconditionally参数:trunk 表示端口允许通过多个 VLAN 的流量;access 为端口只能属于一个VLAN。 Dynamic 表示为动态协商模式命令模式:接口配置模式。 使用指南:工作在trunk mode下的端口称为Trunk端口,Trunk端口可以通过多个VLAN的流量,通过Trunk端口之间的互联,可以实现不同交换机上的相同VLAN的互通;工作在access mode 下的端口称为Access端口,Access端口可以分配给一个VLAN,并且同时只能分配给一个VLAN。举例:将端口8设置为trunk 模式,端口5设置为access模式。test(config-if)#int fa0/8test(config-if)# switchport mode trunk test(config-if)#int fa0/5test(config-if)# switchport mode access 设置Trunk端口允许通过VLAN命令:switchport trunk allowed vlan all add 参数:为允许在该 Trunk 端口上通过的 VLAN 列表;all 关键字表示允许该Trunk端口通过所有VLAN的流量。 命令模式:接口配置模式。 缺省情况:Trunk端口缺省允许通过所有VLAN。 使用指南:用户可以通过本命令设置哪些 VLAN 的流量通过 Trunk 端口,没有包含的VLAN流量则被禁止。 举例:设置Trunk端口允许通过所有VLAN的流量test(config-if)#int fa0/8test(config-if)# switchport mode trunk test(config-if)#switchport trunk allowed vlan all举例:设置Trunk端口允许通过VLAN5-20的流量。 test(config-if)#int fa0/8test(config-if)# switchport mode trunk test(config-if)#switchport trunk allowed vlan add 5-20配置本征vlan命令:switchport trunk native vlan no switchport trunk native vlan功能:设置Trunk端口的PVID;本命令的no操作为恢复缺省值。 参数:为Trunk端口的PVID。 命令模式:接口配置模式。 缺省情况:Trunk端口默认的 PVID为1。 使用指南:在802.1Q中定义
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 初中信息技术基本知识概览
- 全国2024年1月高等教育自学考试犯罪学试题
- 内科护理(医学高级):传染病病人的护理考试题库
- 2026 学龄前自闭症早期感统课件
- 六年级期中数学总结
- 保温工程专业分包合同
- 出境动植物及其产品、其他检疫物的生产、加工、存放单位注册登-样表
- 2026年家庭防灾减灾应急手册
- 浙教版2026届中考英语最后冲刺模拟试卷含答案
- 2026届湖北省宜昌市五峰土家族自治县中考英语全真模拟试卷含答案
- 成品家具购销合同范例
- 进出口业务操作第四版章安平课后参考答案
- 11 《爱莲说》对比阅读-2024-2025中考语文文言文阅读专项训练(含答案)
- T-CPQS C010-2024 鉴赏收藏用潮流玩偶及类似用途产品
- 国开作业《公共关系学》实训项目1:公关三要素分析(六选一)参考552
- 2024年4月自考00228环境与资源保护法学试题及答案
- 汽车配件行业问题报警升级作业流程
- (正式版)SHT 3229-2024 石油化工钢制空冷式热交换器技术规范
- 结构的弹性稳定计算演示文稿
- SB/T 10938-2012果蔬清洗机
- GB/T 4798.6-2012环境条件分类环境参数组分类及其严酷程度分级船用
评论
0/150
提交评论