版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
思科交换机简单配置通用教程第1页,共30页,2023年,2月20日,星期六
思科交换机基本介绍交换机型号Catalyst2960系列交换机Catalyst3560系列交换机Catalyst3750系列交换机Catalyst4500系列交换机Catalyst4948系列交换机Catalyst6500系列交换机第2页,共30页,2023年,2月20日,星期六3560系列交换机三层交换机支持PoE(PoweroverEthernet)设备支持IPv6汇聚层交换机———中型企业第3页,共30页,2023年,2月20日,星期六Catalyst-3560G-24TS技术参数转发带宽:32Gbps每秒分组数:38.7Mpps支持的mac地址:12000支持的路由:11000千兆以太网SFP:410/100/1000端口:24不支持PoE第4页,共30页,2023年,2月20日,星期六思科交换机测试中常用配置第5页,共30页,2023年,2月20日,星期六交换机配置模式用户模式Switch>特权模式Switch>enableSwitch#全局模式Switch#configureterminalSwitch(config)#
每次进入交换机时,首先会进入到用户模式下,在此模式下不能对交换机进行修改、甚至有些信息都无法查看,为了更进一步的对交换机进行操作,我们必须进入到特权模式或全局模式,而从用户模式下只能进入特权模式,再从特权模式进入全局模式,也就是说之中不能跨级。第6页,共30页,2023年,2月20日,星期六更改主机名Switch>enSwitch#conftSwitch(config)#hostname12341234(config)#更改特权密码1234(config)#enablepassword1231234(config)#1234(config)#enablesecret2341234(config)#第7页,共30页,2023年,2月20日,星期六查看全局配置Switch#showrunning-config保存当前配置Switch#copyrunning-configstartup-config恢复出厂默认Switch#erasestartup-configSwitch#reload第8页,共30页,2023年,2月20日,星期六明文密码和密文密码Password1234#showrunning-confighostname1234enablepassword123Secret
1234#showrunning-confighostname1234enablesecret5$1$CCFV$0DTd3rSPZNycrVDjn1rKv/(MD5加密的字符串)enablepassword123当明文和密文同时存在时,密文优先级高。第9页,共30页,2023年,2月20日,星期六端口配置全局模式下进入端口后,可以对端口进行配置。Switch#conftSwitch(config)#interfacegigabitEthernet0/1Switch(config-if)#批量修改端口range命令端口速率:Switch(config-if)#speed?10Force10Mbpsoperation100Force100Mbpsoperation1000Force1000MbpsoperationautoEnableAUTOspeedconfigurationSwitch(config-if)#speedautoSwitch(config-if)#第10页,共30页,2023年,2月20日,星期六双工模式:Switch(config-if)#duplex?autoEnableAUTOduplexconfigurationfullForcefullduplexoperationhalfForcehalf-duplexoperationSwitch(config-if)#duplexautoSwitch(config-if)#端口描述Switch(config-if)#descriptionvlan10trunkSwitch(config-if)#第11页,共30页,2023年,2月20日,星期六Vlan设置Vlan设置范围:1---4094在全局模式下配置vlanSwitch#conftSwitch(config)#vlan10Switch(config-vlan)#namevlan10Switch(config-vlan)#vlan20Switch(config-vlan)#namevlan20Vlan名称可以自行定义Switch#showvlan查看vlan配置信息第12页,共30页,2023年,2月20日,星期六vlan10配置192.168.10.1/24的ip地址Switch#conftSwitch(config)#vlan10Switch(config-vlan)#namevlan10Switch(config-vlan)#exitSwitch(config)#interfacevlan10Switch(config-if)#ipaddress192.168.10.1255.255.255.0Switch(config-if)#endSwitch#copyrunning-configstartup-config配置ip地址的命令格式:ipaddress{ip-address}{netmask}第13页,共30页,2023年,2月20日,星期六测试常用端口类型Access/trunk将此端口设置为vlan10的access口Switch(config-if)#switchportmodeaccessSwitch(config-if)#switchportaccessvlan10Switch(config-if)#将此端口设置为vlan10的trunk口Switch(config-if)#switchporttrunkencapsulationdot1qSwitch(config-if)#switchportmodetrunkSwitch(config-if)#switchporttrunkallowedvlan10第14页,共30页,2023年,2月20日,星期六当一个端口允许多个vlan通过时,trunkallowedvlan中要添加各条vlan信息Switch(config-if)#switchporttrunkencapsulationdot1qSwitch(config-if)#switchportmodetrunkSwitch(config-if)#switchporttrunkallowedvlanallSwitch(config-if)#switchporttrunkallowedvlan10,50,60Switch(config-if)#switchporttrunkallowedvlanadd20(remove删除)Switch(config-if)#switchporttrunkallowedvlanadd30Switch(config-if)#switchporttrunkallowedvlanadd40Switch(config-if)#switchporttrunknativevlan1Switch(config-if)#noshutdownSwitch(config-if)#endSwitch#copyrunning-configstartup-config
此端口为vlan10vlan20vlan30vlan40的trunk口,defaultvlan1经过此端口时不会带上标签。第15页,共30页,2023年,2月20日,星期六光端口配置Switch(config)#interfacegigabitEthernet0/25Switch(config-if)#switchportmodeaccessSwitch(config-if)#switchportaccessvlan10Switch(config-if)#noshutdownSwitch(config-if)#endSwitch#copyrunning-configstartup-config注意:由于思科的交换机只自动识别自己品牌的光模块,所以如果用其他品牌的光模块,需在配置模式下输入一下两条命令,开启兼容性。serviceunsupported-transceivernoerrdisabledetectcausegbic-invalid命令输入完成后保存设置重启设备第16页,共30页,2023年,2月20日,星期六端口镜像配置Cisco3560G配置全局配置下:Switch(config)#monitorsession1destinationinterfacegigabitEthernet0/1Switch(config)#monitorsession1sourceinterfacegigabitEthernet0/2bothSwitch(config)#monitorsession1sourceinterfacegigabitEthernet0/3bothmonitorsession1建立一个端口镜像组Destination监控端口Source镜像端口第17页,共30页,2023年,2月20日,星期六DHCP配置配置一个dhcp给vlan10内的主机分配地址Switch(config)#servicedhcpSwitch(config)#ipdhcppoolvlan10Switch(dhcp-config)#network192.168.10.0255.255.255.0Switch(dhcp-config)#default-router192.168.10.1Switch(dhcp-config)#dns-server192.168.10.2Switch(dhcp-config)#lease32020(天/小时/分钟)(缺省为1天)Switch(dhcp-config)#exitSwitch(config)#ipdhcpexcluded-address192.168.10.1192.168.10.19Switch(config)#ipdhcpexcluded-address排除某些地址,禁止被动态分配DHCP设置是针对全局的,不是定义在某个接口上的。DHCP调试命令Switch(config)#noservicedhcp关闭dhcp服务Switch#showipdhcpbinding查看dhcp分配情况第18页,共30页,2023年,2月20日,星期六思科作DHCPserver给AP分地址在server中设置Option43、Option60字段信息。Switch(config)#ipdhcppoolvlan20Switch(dhcp-config)#network192.168.1.0255.255.255.0Switch(dhcp-config)#default-router192.168.1.1Switch(dhcp-config)#option43hex01060104c0a801e4Switch(dhcp-config)#option60hexxxxxxxxxxxxx(AC回的offer包中的信息)Switch(dhcp-config)#lease1Switch(dhcp-config)#endSwitch#copyrunning-configstartup-config第19页,共30页,2023年,2月20日,星期六DHCPrelay配置DHCPrelay功能可以汇聚处于不同广播域的客户端的DHCP请求,转发给DHCP服务器,并发送DHCP服务器的响应给各个客户端,也就是起到了DHCP报文在各个网段的转发功能。Cisco的设备需要启用iphelper-address命令,来实现此功能。配置了iphelper-address命令之后的交换机在中继DHCP请求时的工作过程如下:(1)DHCP客户端发送请求,由于没有IP地址,所以自己的源IP地址为0.0.0.0,而且也不知道目的DHCP服务器的地址,所以广播255.255.255.255。该数据报文中还包括源mac地址和目的mac地址(全F)。(2)当交换机接收到该数据包的时候,它就用自己的接口地址来取代源地址0.0.0.0,并且用iphelper-address命令置顶的地址来取代目的地址255.255.255.255。(3)当DHCP服务器接收到交换机转发过来的DHCP请求包时,它会做出响应,并且由交换机把数据包转发回客户端。第20页,共30页,2023年,2月20日,星期六DHCPrelay配置Switch(config)#vlan100Switch(config-vlan)#namevlan100Switch(config-vlan)#intvlan100Switch(config-if)#iphelper-address192.168.1.228Switch(config-if)#exitSwitch(config)#servicedhcpSwitch(config)#ipdhcprelayinformationtrust-allSwitch(config)#endSwitch#copyrunning-configstartup-config第21页,共30页,2023年,2月20日,星期六DHCPrelay功能测试实例:AClan端口开启dhcpserverdhcpserver1:192.168.20.10---192.168.20.100/24的地址,网关为192.168.20.1。dhcpserver2:192.168.30.10---192.168.30.100/24的地址,网关为192.168.30.1。AClan端口地址为192.168.1.228正确配置交换机和AC使AP获得相应地址并上线。AClan3560GAP1AP2Vlan30Vlan20Vlan10第22页,共30页,2023年,2月20日,星期六Cisco3560G配置interfaceGigabitEthernet0/1interfaceVlan10switchportaccessvlan10ipaddress192.168.1.1255.255.255.0switchportmodeaccess!interfaceGigabitEthernet0/2interfaceVlan20switchportaccessvlan20ipaddress192.168.20.1255.255.255.0switchportmodeaccessiphelper-address192.168.1.228!interfaceGigabitEthernet0/3interfaceVlan30switchportaccessvlan30ipaddress192.168.30.1255.255.255.0switchportmodeaccessiphelper-address192.168.1.228iproutingservicedhcpipdhcprelayinformationtrust-all第23页,共30页,2023年,2月20日,星期六AC配置瘦AP端口地址:192.168.1.228255.255.255.0瘦AP端口DHCP:dhcpserver1:192.168.20.10---192.168.20.100/24的地址,网关为192.168.20.1。dhcpserver2:192.168.30.10---192.168.30.100/24的地址,网关为192.168.30.1。静态路由:目的地址0.0.0.0子网掩码0.0.0.0下一跳192.168.1.1第24页,共30页,2023年,2月20日,星期六静态路由设置Switch(config)#iprouting(全局路由)思科默认不开启Switch(config)#iproute192.168.2.0255.255.255.0192.168.1.1(静态路由格式:目的地址子网掩码下一跳)静态路由测试实例3560GPCACStaAPVlan2Vlan1Vlan3Vlan2第25页,共30页,2023年,2月20日,星期六AP通过dhcp方式上线,集中转发正常广播SSIDAC开启2个虚接口,STA连接vif1,Vif1属于vlan1地址192.168.10.1/24,vif2属于vlan2地址192.168.20.1/243560G1端口与AC的vif2相连,地址为192.168.20.2/243560G2端口与PC相连,地址为192.168.30.1/24PC的地址为192.168.30.1/24网关为192.168.30.1测试要求:STA正常获得地址并且与PC通信。第26页,共30页,2023年,2月20日,星期六Cisco3560G配置interfaceVlan20ipaddress192.168.2
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024届单招试卷及答案
- 安全员A证考试真题汇编含答案详解【培优a卷】
- 导游证书考试试题及答案解析
- 施工区域工作面安全隔离方案
- 安全员A证考试模拟卷包及完整答案详解(网校专用)
- 安全员A证考试练习题附答案详解(轻巧夺冠)
- b2满分学习题库及答案
- 工程物料消耗情况评估方案
- 2025年八上道法情景题目及答案
- 未来五年涉外仲裁服务企业数字化转型与智慧升级战略分析研究报告
- 农艺工教学计划
- TSZSA 015-2024 COB LED光源封装产品技术规范
- 2024新外研社版英语七下单词默写表(开学版)
- 卫生管理组织制度模版(2篇)
- 《游园》课件统编版高中语文必修下册
- 质量责任划分制度
- JT∕T 1496-2024 公路隧道施工门禁系统技术要求
- 2024版美团商家合作协议合同范本
- 一年级上册数学应用题50道(重点)
- 嵌入式系统实现与创新应用智慧树知到期末考试答案章节答案2024年山东大学
- 线缆及线束组件检验标准
评论
0/150
提交评论