




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、icisco 网络交换机配置手册网络交换机配置手册目目 录录一、网络拓扑一、网络拓扑.3二、连接设备的方法二、连接设备的方法.31、从CONSOLE连接:.32、远程TELNET连接.3三、三、CISCO 交换机基本配置的方法交换机基本配置的方法.41、配置设备特权模式口令.42、配置虚拟终端线路 VTY(VIRTUAL TYPE TERMINAL).43、定义、删除(恢复初始)设备名称.44、配置SNMP网管串.55、新建、修改、删除某个 VLAN,以及对 VLAN 命名.56、将某个端口或者一组端口,划分到 VLAN.57、配置端口工作模式.68、配置端口速率.69、配置一个或多个 VLA
2、N 网关.610、配置交换机设备的管理地址.611、为某个端口配置一个或多个地址.612、将设备互联的端口设置为TRUNK,让其通过VLAN信息.713、新建PORT-CHANNEL,并将多个端口划分到该PORT-CHANNEL.714、删除PORT-CHANNEL,并将该PORT-CHANNEL下的端口删除 .715、在三层交换机上配置静态路由.716、将源端口的流入或流出流量镜像到目的端口.717、SHOW 命令的使用 .8ii18、限流方法:.1119、ACL 使用方法.1120、在两台 6509 上配置 HSRP.1221、配置端口 MAC 梆定.13四、交换机的日常维护四、交换机的日
3、常维护.13 3一、网络拓扑一、网络拓扑参见三地网络拓扑图。二、连接设备二、连接设备的方法的方法1、从 console 连接:用 Console 线和转接头将交换机的 console 口与 PC 的串口相联,图示如下:设置如下图(默认设置):2、远程 telnet 连接给交换机配置了管理地址,就可以直接采用远程 telnet 登陆进入交换机了,但是必须先配置 line vty 的密码和 enable 密码才能允许远程登陆。4三、三、cisco 交换机基本配置交换机基本配置的方法的方法1、配置设备特权模式口令telnet *.*.*.*Switch 进入用户模式Switch enable 从用户
4、模式进入特权模式Switch # config terminal 从特权模式进入全局配置模式Switch # exit 退出所有配置模式Switch # end 退出配置模式Switch # wr 保存配置Switch(config)# enable secret cisco123 设置特权模式加密口令(机房使用方法)Switch(config)# enable password cisco123设置特权模式不加密口令Switch(config)# service password-encryption 将所有口令进行加密2、配置虚拟终端线路 VTY(Virtual Type Terminal
5、)Switch(config)# line vty 0 4Switch(config-line)# login让设备回显一个要求输入口令的提示Switch(config-line)# password cisco Telnet 统一密码Switch(config-line)# exec-timeout 10 0设备超时时间为 10 分钟 0 秒Switch(config)# line vty 0 4Switch# (config-line)# login local 设置本地认证模式Switch (config)# username zhangxy password *Switch (conf
6、ig)# no username zhangxy53、定义、删除(恢复初始)设备名称Switch(config)# hostname test-2950test-2950(config)# no hostname4、配置 snmp 网管串Switch(config)# snmp-server community xxxxxx ro (只读)Switch(config)# snmp-server community xxxxxx rw (读写)5、新建、修改、删除某个 VLAN,以及对 VLAN 命名Switch# vlan databaseSwitch(vlan)# vlan 100Switc
7、h(vlan)# vlan 100 name XX (名字一般定义为客户名称或者共享网段标识)Switch(vlan)# no vlan 100或者或者Switch# conf tSwitch(config)#vlan 100Switch (config-vlan)#name XX (名字一般定义为客户名称或者共享网段标识)Switch (config)#no vlan 1006、将某个端口或者一组端口,划分到 VLANSwitch(config)# interface f0/13 (进入单个端口配置模式)Switch(config)# interface range f0/1-5(进入一组端
8、口配置模式)Switch(config)# interface range f0/1-5, f0/8-10(进入一组端口配置模式)Switch(config-if)# (端口描述)Description 客户名称拼音的全拼(首字母大写) ip=地址 带宽 操作日期Switch(config-if)# switchport mode accessSwitch(config-if)# switchport access vlan 100Switch(config-if)# no shutdownSwitch(config-if)# no switchport (删除端口相关配置)67、配置端口工作
9、模式Switch(config-if)# duplex full/auto/half全双工|自动协商|半双工8、配置端口速率Switch(config-if)# speed 10/100/ auto9、配置一个或多个 VLAN 网关Switch(config)# int vlan 100 Switch(config-subif)# Description 客户名称 ip=地址 带宽 操作日期(描述)Switch(config-subif)# ip address 30 Switch(config-subif)#ip address 192.168
10、.3.130 secondarySwitch(config-subif)# no shutdown10、配置交换机设备的管理地址配置二层交换机设备的管理地址:配置二层交换机设备的管理地址:Switch(config)# int vlan 1 (交换机 VLAN1 的网关地址就是设备的管理地址)Switch(config-subif)# ip address 30 Switch(config-subif)# no shutdown配置三层交换机的设备管理地址:配置三层交换机的设备管理地址:Switch(config)#
11、int loopback0 loopback 接口是一种逻辑接口,可以创建无数个Switch(config-if)# ip address 30 Switch (config)# no int loopback 011、为某个端口配置一个或多个地址Switch(config)# interface f0/13Switch(config-if)# ip address 30 Switch(config-if)# ip address 30 second
12、ary712、将设备互联的端口设置为 trunk,让其通过 vlan 信息Switch(config)# int range f0/40,f0/48 (range 的作用是同时对多个端口进行配置)Switch(config-if)# switchport trunk encapsulation dot1qSwitch(config-if)# switchport trunk allowed vlan 1-10,12-4094(没有这句配置,则说明所有VLAN均能通过trunk)Switch(config-if)# switchport mode trunk(如果要增加vlan 100划分到tr
13、uck时,必须把原有的vlan再都写上)Switch(config-if)# switchport trunk allowed vlan 1-10,100,12-409413、新建 port-channel,并将多个端口划分到该 port-channelSwitch (config)# interface port-channel 1Switch(config)# interface f0/1Switch (config-if)# channel-group 1 mode onSwitch(config)# interface f0/2Switch (config-if)# channel-g
14、roup 1 mode on14、删除 port-channel,并将该 port-channel 下的端口删除Switch (config)# interface f0/1Switch (config-if)# no channel-group 1Switch (config)# no interface port-channel 115、在三层交换机上配置静态路由Switch (config)# ip route ip route 目标地址段 下一跳地址16、将源端口的流入或流出流量镜像到目的端口将源端口的流入或流出流量镜
15、像到目的端口以便于在目的端口接上笔记本电脑,利用anylazer 软件抓包,并分析数据包是否正常。假设 6509 G4/1 作为目的端口,将 G4/2 作为源8端口。实际应用中一般来说,源端口和目的端口速率应该一致。IDC-BJ02-6509-1(config)#monitor session 2 source interface g4/1 bothIDC-BJ02-6509-1(config)#monitor session 2 destination interface g4/217、SHOW 命令的使用# show version 显示系统硬件配置、软件版本信息及最近一次启动以来连续运行
16、的时间等# show running-configuration 显示设备运行配置信息# show running-config int f0/13显示某个端口的配置信息#show vlan 显示所有 VLAN 信息# show interface f0/13 显示设备所有或指定接口的状态信息# show int description 显示所有端口的描述信息显示所有端口的描述信息# show int status 显示所有端口的状态信息显示所有端口的状态信息# show ip int brief 显示所有端口显示所有端口 IP 摘要摘要# show arp 显示所有地址解析协议信息显示所有地
17、址解析协议信息# show mac-address-table 显示 MAC 地址表内容# show ip 显示设备上配置的 IP 地址、子网掩码、网关地址参数,管理VLAN 号、域名解析服务器、HTTP 信息及路由协议设定等(该命令不被路由器支持,只被交换机支持)# show ip router 显示某个或所有的路由信息# show spanning-tree 显示 STP 信息# show logging 查看系统当前日志设置和缓冲区里的日志信息# show history 查看命令缓冲区内容#show proc cpu | exc 0.00 显示 CPU 占用的情况(exc 表示除值为
18、0 以外的进程)#show platform cpu packet stat#show monitor session1 显示镜像端口的流量情况显示镜像端口的流量情况下面列举常用命令:下面列举常用命令:6509-1# show interface f0/13 显示设备所有或指定接口的状态信息FastEthernet0/29 is up, line protocol is up (connected)9下面列出下面列出 cisco 二层、三层交换机端口不同显示状态的线路连接情况:二层、三层交换机端口不同显示状态的线路连接情况:二层交换机端口状态:二层交换机端口状态:Statusline prot
19、ocol线路连接情况线路连接情况administratively downdown管理员手工关闭端口downdown (notconnect)端口己打开,但没插线(初始态)upUp(connect)端口己打开,并且己插线三层交换机端口状态:三层交换机端口状态:Statusline protocol线路连接情况线路连接情况administratively downdown (disabled)管理员手工关闭端口updown端口己打开,但没插线(初始态)upup端口己打开,并且己插线6509-1#sh ip int briefInterface IP-Address OK? Method Stat
20、us ProtocolVlan1 unassigned YES NVRAM administratively down down Vlan75 13 YES NVRAM up up Vlan501 YES NVRAM administratively down down GigabitEthernet1/1 unassigned YES NVRAM up down GigabitEthernet1/2 unassigned YES NVRAM administratively down down GigabitEthernet3/1 211.10
21、0.2.45 YES NVRAM up up FastEthernet5/22 unassigned YES unset up up FastEthernet5/23 unassigned YES unset up down FastEthernet5/25 unassigned YES unset administratively down down6509-1#sh int description Interface Status Protocol DescriptionVl10 admin down down Vl501 admin down down Share34.1Vl583 up
22、 up DongFangWangJing1Vl701 admin down down ChengHeWang 20041229Gi1/2 admin down down Gi3/1 up up To M320 G0/2/3 Gi3/5 up down Fa5/5 up up YiFangDa Ip=* 20060601Fa5/11 up down TianYuanKeJi ip=* 20060525Fa5/25 admin down down 6509-1#sh arp10Protocol Address Age (min) Hardware Addr Type InterfaceIntern
23、et 8 35 0010.db76.8f80 ARPA FastEthernet6/48Internet 71 53 0030.4857.353c ARPA Vlan584Internet 61 - 00d0.0106.5800 ARPA Vlan755Internet 69 0 000f.b587.b194 ARPA Vlan705Internet 65 0 Incomplete ARPA 6509-1#sh int statusPort Name Status Vlan
24、Duplex Speed TypeGi1/1 notconnect routed full 1000 No GBICGi1/2 disabled routed full 1000 No GBICGi4/3 disabled 747 full 1000 1000BaseSGi3/1 To M320 G0/2/3 connected routed full 1000 1000BaseSXGi3/3 disabled 1 full 1000 Fa5/1 To 2950-4 0/1 connected trunk full 100 10/100BaseTXcisco7507#sh versionCis
25、co Internetwork Operating System Software IOS (tm) RSP Software (RSP-PV-M), Version 12.0(17)S, EARLY DEPLOYMENT RELEASE ISO 版本信息ROM: System Bootstrap, Version 11.1(8)CA1, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1)ROM 版本信息cisco7507 uptime is 19 weeks, 3 days, 4 hours, 6 minutes 设备开机时间System image file i
26、s slot0:rsp-pv-mz.120-17.S.binFlash 中的 IOS 映像文件名cisco RSP4 (R5000) processor with 262144K/2072K bytes of memory.处理器信息1 GEIP controller (1 GigabitEthernet).3 VIP2 R5K controllers (4 FastEthernet)(2 Serial)(2 POS).4 FastEthernet/IEEE 802.3 interface(s)1 GigabitEthernet/IEEE 802.3 interface(s)2 Serial
27、network interface(s)2 Packet over SONET network interface(s)123K bytes of non-volatile configuration memory.NVRAM 值Configuration register is 0 x2102 配置存储器值查看及修改系统当前日志设置和缓冲区里的日志信息:查看及修改系统当前日志设置和缓冲区里的日志信息:cisco7507#sh loggingSyslog logging: enabled (0 messages dropped, 0 flushes, 0 overruns) Console l
28、ogging: level debugging, 1957 messages logged 控制台的日志信息 Monitor logging: level debugging, 73 messages loggedTelnet 客户端发送的系统日志 Buffer logging: disabled缓冲区日志 Logging Exception size (65536 bytes)Trap logging: level informational, 472 message lines logg向 SNMP 管理软件发送的系统日志cisco7507#conf t 11cisco7507(confi
29、g)#logging buffercisco7507(config)#no logging buffer18、限流方法:Cisco 设备制定限流策略以及应用:设备制定限流策略以及应用:Switch# conf tSwitch (config)# access-list 1 permit anySwitch (config)# class-map match-all c9MSwitch (config-cmap)# match access-group 1Switch (config-cmap)# exitSwitch(config)# policy-map p9MSwitch (config-
30、pmap)# class c9MSwitch (config-pmap-c)# police 9000000 4096 exceed-action dropSwitch (config-pmap-c)# exitSwitch# conf tSwitch(config)# interface f0/13Switch(config-if)# service-policy input p9MSwitch(config-if)# exitSwitch(config)# interface f0/14Switch(config-if)# service-policy input p9MSwitch(co
31、nfig-if)# exitSwitch# wr19、ACL 使用方法Switch (config)# access-list access-list-number permit|denyprotocolsource source-wildcard|anydestination destination-wildcard|any例 1:允许北京电信 IDC 内部的 ip 地址 telnet 到各个网络设备Switch (config)# access-list 101 permit tcp 3 any eq telnetSwitch (config)# ac
32、cess-list 101 permit tcp 27 any eq telnetSwitch (config)# access-list 101 permit tcp 55 any eq telnet12例例 2:ACLACL 限制对客户的限制对客户的 1919 的访问的访问Switch (config)# access-list 130 deny ip host 19 anySwitch (config)# access-list 130 permi
33、t ip any anySwitch(config)# interface f0/22Switch(config-if)# ip access-group 130 in例 3:(VLAN 31) 、(VLAN 32) 、(VLAN 33)三个网段之间不能互相访问,其他网段均能访问,配置方法如下:SS6509-1#conf tSS6509-1(config)# access-list 101 deny ip any 55SS6509-1(config)# access-list 101 deny
34、ip any 55SS6509-1(config)# access-list 101 permit ip any anySS6509-1(config)# access-list 102 deny ip any 55SS6509-1(config)# access-list 102 deny ip any 55SS6509-1(config)# access-list 102 permit ip any anySS6509-1(config)# access-list 103
35、 deny ip any 55SS6509-1(config)# access-list 103 deny ip any 55SS6509-1(config)# access-list 103 permit ip any anySS6509-1(config)#int vlan 31SS6509-1(config-if)# ip access-group 101 inSS6509-1(config)#int vlan 32SS6509-1(config-if)# ip access-group 102 inSS65
36、09-1(config)#int vlan 33SS6509-1(config-if)# ip access-group 103 in20、在两台 6509 上配置 HSRP将需要起 HSRP 的三层端口分别在两台主备 6509 上进行如下配置:SS6509-1#vlan databaseSS6509-1 (vlan)#vlan 31 name *SS6509-1 (vlan)#exit13SS6509-1#conf tSS6509-1(config)#int vlan 31SS6509-1(config-if)#description * *SS6509-1(config-if)#ip ad
37、dress 52 SS6509-1(config-if)#standby 100 ip 54 (定义 standby 组号及虚 IP 地址)SS6509-1(config-if)#standby 100 priority 120(定义该设备本 standby 组的优先级,优先级的值越大优先级越高)SS6509-2#vlan databaseSS6509-2 (vlan)#vlan 31 name *SS6509-2(vlan)#exitSS6509-2#conf tSS6509-2(config)#int vlan 31SS65
38、09-2(config-if)#description * *SS6509-2(config-if)#ip address 53 SS6509-2(config-if)#standby 100 ip 54 (定义 standby 组号及虚 IP 地址)SS6509-2(config-if)#standby 100 priority 100(定义该设备本 standby 组的优先级)21、配置端口 MAC 梆定Switch(config)# mac access-list extended f02Switch(config-ext
39、-macl)# permit host 0016.d325.f96a anySwitch(config)# interface FastEthernet0/2Switch(config-if)# mac access-group f02 in四、四、交换机的日常维护交换机的日常维护1、更改交换机的 telnet、enable 密码(详见上面操作)2、更改交换机的 SNMP 串(详见上面操作)3、增加、删除 VLAN(详见上面操作)4、开、关闭端口(详见上面操作)145、定期保存所有交换机的配置信息,遇到突发情况恢复交换机的配置交换机的 IOS 保存和恢复是采用 TFTP 协议完成,所以首先你必
40、须要下载一个 TFTP软件,然后按照下面的步骤来进行: 在你的机器上启动 TFTP 。 登陆到 3500 交换机,然后在 enable 状态下输入如下命令来完成 IOS 的保存: switch# copy flash tftp Source IP address or hostname 71? Source filename ? cat6000-sup2k8.7-1-1.binDestination filename cat6000-sup2k8.7-1-1.binn? Loading cat6000-sup2k8.7-1-1.bin to 71
41、 (via VLAN1): !OK - 1125001 bytes 恢复配置时,执行如下命令: switch# copy tftp flashSource IP address or hostname ? 71Source filename ? cat6000-sup2k8.7-1-1.binDestination filename cat6000-sup2k8.7-1-1.bin? yLoading cat6000-sup2k8.7-1-1.bin from 71 (via VLAN1): !OK - 1125001 bytes6、交换机 IO
42、S 版本升级7、恢复交换机口令(不同款交换机恢复口令的方法详见pswdrec_3700 )以 2950 为例,恢复口令的操作方法如下:Connect a terminal or PC with terminal emulation software to the console port. For more information,refer to the switch hardware installation guide.Step 2 Set the line speed on the emulation software to 9600 baud.Step 3 Unplug the switch power cord.Step 4 Press the Mode button, and at the same time, reconnect the power cord to the switch.You can release the Mode button a second or two after the LED above port 1X goes off. Several lines ofinformation
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 如何进行生产成本控制计划
- 嫩江县电梯安全管理人员小测试题卷以及答案
- 如何激励团队提升品牌实施效果计划
- 商用房屋租房合同
- 内墙装修施工合同
- 新华保险新人培训
- 语言文字规范培训
- 医疗器械创新研发考核试卷
- 收养家庭跟踪评估与持续支持考核试卷
- 油气田生产测井与监测技术考核试卷
- 江苏省徐州市树恩中学2024-2025学年高一下学期第一次月考地理试题(含答案)
- 汽车行业发展前景
- 沥青搅拌站应急预案与响应流程
- 用电知识安全培训课件
- 档案数字化管理试题及答案
- 书法报名合作合同标准文本
- 2025届广东省佛山市高三上学期一模生物试题含答案
- 2.2城镇化课件高中地理人教版(2019)必修二
- 2025年3月版安全环境职业健康法律法规标准文件清单
- 2025河南中烟漯河卷烟厂招聘7人易考易错模拟试题(共500题)试卷后附参考答案
- 2024-2025学年历史统编版七年级下册期末评估测试卷 (含答案)
评论
0/150
提交评论