Cisco交换机的基本配置解读
- 格式:ppt
- 大小:454.50 KB
- 文档页数:17
思科交换机的基本配置随着Internet的高速发展,网络规模不断膨胀,对于从事网络专业的学生熟练掌握路由器和交换机的配置已显得十分重要。
接下来是小编为大家收集的思科交换机的基本配置方法,希望能帮到大家。
思科交换机的基本配置的方法一、交换机的基本配置Author:chenchao in ZJNU从本篇文章开始,将连载大概8-9篇自己学习交换与路由的实验报告,但是怕自己能力不行,会出现错误,所以,先载两篇文章,依次为:交换机的基本配置;路由器基本配置。
本篇为交换机的基本配置,使用的仿真软件是Cisco的一款免费软件:Cisco Packet Tracer。
想学习的可以在百度自行下载。
下面开始附上实验过程:实验环境:Cisco 2950交换机1台,Console电缆1根,PC机一台,网线1根。
连接如下图所示:实验步骤:一、交换机的带外配置;1、在用户模式、特权模式、全局模式、接口模式之间转换;Switch>enableSwitch#configure terminalEnter configuration commands, one perline. End with CNTL/Z.Switch(config)#interface FastEthernet 0/1Switch(config-if)#exitSwitch(config)#exitSwitch#%SYS-5-CONFIG_I: Configured from console byconsoleSwitch#exitSwitch con0 is now availablePress RETURN to get started.Switch>2、将交换机的名称改为“student”;Switch(config)#hostname studentstudent(config)#3、为交换机各个模式设置密码“cisco”;特权模式下的密码保护student#enablestudent#configure tEnter configuration commands, one perline. End with CNTL/Z.student(config)#enable password ciscostudent(config)#enable secret cisco1远程登录口令设置student#configure tEnter configuration commands, one perline. End with CNTL/Z.student(config)#line console 0student(config-line)#line vty 0 4student(config-line)#password cisco2student(config-line)#loginstudent(config-line)#student#4、为交换机制定一个IP地址10.10.10.X/24;student#configConfiguring from terminal, memory, ornetwork [terminal]?Enter configuration commands, one perline. End with CNTL/Z.student(config)#interface vlan 1student(config-if)#ip address 10.10.10.1255.0.0.05、开启交换机的Telnet服务功能,建立Telnet用户admin,口令cisco,并制定只能从10.10.10.y/24登录Telnet服务器;student#student#configure tEnter configuration commands, one perline. End with CNTL/Z.student(config)#user admin password 0 ciscostudent(config)#6、查看配置情况;student>enablePassword:student#show running-cBuilding configuration...hostname student!enable secret 5$1$mERr$q.MA2tj.WFptzvbifq/1i.enable password cisco!!username admin password 0 ciscointerface Vlan1ipaddress 10.10.10.1 255.0.0.0!!line con 0!line vty 0 4password cisco2loginline vty 5 15login!!End二、交换机的端口配置:1、配置接口的描述、关闭借口、启动接口、配置接口的速度为100Mbps、配置接口工作模式为全双工、配置接口的流程控制;student#configure terminalEnter configuration commands, one perline. End with CNTL/Z.student(config)#interface FastEthernet0/1student(config-if)#shutdown%LINK-5-CHANGED: Interface FastEthernet0/1,changed state to administratively down%LINEPROTO-5-UPDOWN: Line protocol onInterface FastEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol onInterface Vlan1, changed state to downstudent(config-if)#student(config-if)#exitstudent(config)#interface FastEthernet0/1student(config-if)#no shutdown%LINK-5-CHANGED: Interface FastEthernet0/1,changed state to up%LINEPROTO-5-UPDOWN: Line protocol onInterface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol onInterface Vlan1, changed state to upstudent(config-if)#speed 100student(config-if)#duplex full%LINK-5-CHANGED: Interface FastEthernet0/1,changed state to down%LINEPROTO-5-UPDOWN: Line protocol onInterface FastEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol onInterface Vlan1, changed state to downstudent(config-if)#2、配置接口FastEthernet0/10为Access口;student#student#configure terminalEnter configuration commands, one perline. End with CNTL/Z.student(config)#interface FastEthernet0/10student(config-if)#switchport mode accessstudent(config-if)#3、配置接口FastEthernet0/12为Trunk口;student#student#configure tEnter configuration commands, one perline. End with CNTL/Z.student(config)#interface fastethernet0/12student(config-if)#switchport mode Trunkstudent(config-if)#end4、查看配置情况;!interface FastEthernet0/1duplex fullspeed100!!interface FastEthernet0/9!interface FastEthernet0/10switchport mode access!interface FastEthernet0/11!interface FastEthernet0/12switchport mode trunk!student#show running-cBuilding configuration...Current configuration : 1275 bytes!version 12.1no service timestamps log datetime msecno service timestamps debug datetime msec no service password-encryption!hostname student!enable secret 5$1$mERr$q.MA2tj.WFptzvbifq/1i. enable password cisco!!username admin password 0 cisco!!duplex fullspeed 100!interface FastEthernet0/2 !interface FastEthernet0/3 !interface FastEthernet0/4 !interface FastEthernet0/5 !interface FastEthernet0/6 !interface FastEthernet0/7 !interface FastEthernet0/8 !interface FastEthernet0/9 !interface FastEthernet0/10 switchport mode access !interface FastEthernet0/11 !interface FastEthernet0/12 switchport mode trunk!interface FastEthernet0/13 !!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface FastEthernet0/20!interface FastEthernet0/21!interface FastEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24!interface GigabitEthernet1/1 !interface GigabitEthernet1/2 !interface Vlan1ipaddress 10.10.10.1 255.0.0.0 !!line con 0!line vty 0 4password cisco2loginline vty 5 15login!!end看了“思科交换机的基本配置”还想看:。
CISCO交换机基本配置和使用概述CISCO交换机是一种常用的网络设备,用于构建局域网(Local Area Network,LAN)。
它可以通过物理线路的连接,将多台计算机或其他网络设备连接到同一个网络中,实现数据的传输和共享。
CISCO交换机的基本配置包括IP地址的配置、VLAN的配置、端口配置、安全性配置等。
接下来,我们将对这些配置进行详细说明。
首先,IP地址的配置是CISCO交换机的基本操作之一。
通过配置IP地址,我们可以对交换机进行管理和监控。
具体的配置步骤如下:1. 进入交换机的配置模式。
在命令行界面输入"enable"命令,进入特权模式。
2. 进入全局配置模式。
在特权模式下输入"configure terminal"命令,进入全局配置模式。
3. 配置交换机的IP地址。
在全局配置模式下输入"interfacevlan 1"命令,进入虚拟局域网1的接口配置模式。
然后输入"ip address 192.168.1.1 255.255.255.0"命令,配置交换机的IP地址和子网掩码。
4. 保存配置并退出。
在接口配置模式下输入"exit"命令,返回到全局配置模式。
然后输入"exit"命令,返回到特权模式。
最后输入"copy running-config startup-config"命令,保存配置到闪存中。
其次,VLAN的配置是CISCO交换机的关键配置之一。
通过配置VLAN,我们可以将交换机的端口划分为不同的虚拟局域网,实现数据的隔离和安全。
1. 进入交换机的配置模式。
同样,在特权模式下输入"configure terminal"命令,进入全局配置模式。
2. 创建VLAN。
在全局配置模式下输入"vlan 10"命令,创建一个编号为10的VLAN。
交换机的基本配置一、实验目的1、熟悉Cisco IOS的基本配置方式2、掌握交换机的基本配置命令二、相关知识IOS(Internetworking Operating System-Cisco,缩写IOS),CISCO网络配置系统,大多数Cisco设备中安装有此操作系统。
要配置好Cisco设备必需要熟悉IOS命令及相关的知识。
本实验以交换机为对象,其他设备的配置与此类似。
(一)交换机的初始配置为了配置或检查交换机,需要将一台计算机连接到交换机上,并建立双方之间的通信。
使用一根反接线连接交换机背面的“console port”和计算机背面的串口”com port”。
如图,用反接线一端通过RJ-45到DB-9连接器与计算机的串行口(如COM1口)相连,另一端与交换机的CONSOLE端口相连。
所谓交换机的初始配置是指第一次进行交换机的配置。
第一次配置主要包括交换机的主机名、密码和管理IP地址的配置。
启动计算机的“超级终端(HyperTerminal)”程序,会显示一个如图所示的对话窗口。
第一次建立交换机和超级终端的连接时,首先要为这一连接命名。
在下拉菜单中选择连接交换机所使用的COM端口,点击确定按钮,如图所示。
第二个对话窗口出现,点击“还原为默认值”后,点击确定按钮。
在交换机完成启动与超级终端建立连接之后,会出现关于系统配置对话的提示。
此时就可以对交换机进行手工配置。
注:交换机启动时,首先运行ROM中的程序,进行系统自检及引导,然后加载FLASH 中的IOS到RAM中运行,并在NVRAM中寻找交换机的配置文件,将其装入RAM中。
(二)几种常见配置命令模式交换机各种配置必须在不同的配置方式下才能完成,CISCO交换机提供了六种主要配置模式,分别为:(1)普通用户模式交换机初始化完成后,首先要进入一般用户模式,在一般用户模式下,用户只能运行少数的命令,而且不能对交换机进行配置。
在没有进行任何配置的情况下,缺省的交换机提示符为:Switch>在用户配置模式下键入“?”则可以查看该模式下所提供的所有命令集及其功能,出现的“--More—”表示屏幕命令还未显示完,此时可按“回车键(Enter)”或者“空格键”显示余下的命令。
思科交换机的基本配置命令网络技术知识其实也是弱电里面的一个难点,这个一般是在大学课程里面才能详细的学习,今天小编带来的是交换机的基本配置命令。
一、基本配置命令switch>用户模式1:进入特权模式enableswitch>enableswitch#2:进入全局配置模式configureterminalswitch>enableswitch#configureterminalswitch(conf)#3:交换机命名hostnameaptech2950以aptech2950为例switch>enableswitch#configureterminalswitch(conf)#hostnameaptch-2950aptech2950(conf)#4:配置使能口令enablepasswordcisco以cisco为例switch>enableswitch#configureterminalswitch(conf)#hostnameaptch2950aptech2950(conf)#enablepasswordcisco5:配置使能密码enablesecretciscolab以cicsolab为例switch>enableswitch#configureterminalswitch(conf)#hostnameaptch2950aptech2950(conf)#enablesecretciscolab6:设置虚拟局域网vlan1interfacevlan1switch>enableswitch#configureterminalswitch(conf)#hostnameaptch2950aptech2950(conf)#interfacevlan1aptech2950(conf-if)#ipaddress192.168.1.1255.255.255.0配置交换机端口ip和子网掩码aptech2950(conf-if)#noshut是配置处于运行中aptech2950(conf-if)#exitaptech2950(conf)#ipdefault-gateway192.168.254设置网关地址7:进入交换机某一端口interfacefasteher0/17以17端口为例switch>enableswitch#configureterminalswitch(conf)#hostnameaptch2950aptech2950(conf)#interfacefasteher0/17aptech2950(conf-if)#8:查看命令showswitch>enableswitch#showversion察看系统中的所有版本信息showinterfacevlan1查看交换机有关ip协议的配置信息showrunning-configure查看交换机当前起作用的配置信息showinterfacefastether0/1察看交换机1接口具体配置和统计信息showmac-address-table查看mac地址表showmac-address-tableaging-time查看mac地址表自动老化时间9:交换机恢复出厂默认恢复命令switch>enableswitch#erasestartup-configureswitch#reload10:双工模式设置switch>enableswitch#configureterminalswitch2950(conf)#hostnameaptch-2950aptech2950(conf)#interfacefasteher0/17以17端口为例aptech2950(conf-if)#duplexfull/half/auto有full,half,auto三个可选项11:cdp相关命令switch>enableswitch#showcdp查看设备的cdp全局配置信息showcdpinterfacefastether0/17查看17端口的cdp配置信息showcdptraffic查看有关cdp包的统计信息showcdpnerghbors列出与设备相连的cisco设备12:csico2950的密码恢复拔下交换机电源线。
•配置Cisco交换机启动及基本设置本实验是对Cisco Catalyst 1900系列交换机的启动和基本设置的操作。
本实验是对Cisco Catalyst 1900系列交换机的启动和基本设置的操作。
1.实验目的通过本实验,读者可以掌握以下技能熟悉交换机的开机界面;对交换机进行基本的设置;理解交换机的端口及其编号。
2.设备需求本实验需要以下设备:Cisco Catalyst 1900系列交换机1台,型号不限,企业版软件,本实验中使用了1912交换机;PC机1台,操作系统为Windows系列。
装有超级终端程序;Console电缆1条及相应的接口转换器。
3.线缆连接及配置说明如图3.1所示,PC机通过串口与交换机的Console端口相连。
和路由器一样,Cisco交换机的Console端口的缺省设置如下端口速率:9600bit/s数据位:8奇偶校验:无停止位:1流控:无把PC机超级终端程序中串行端口的属性设置成与上述参数一致后,便可以开始实验。
4.实验配置及监测结果在PC机启动正常,PC机与交换机使用Console电缆连接起来,并且已经进入超级终端程序的情况下。
接通交换机电源。
由于交换机没有电源开关,接通电源即直接插上电源插头。
监测清单3.1记录了Catalyst 1912交换机启动的全过程。
监测清单3-1 Catalyst 1912交换机启动及基本配置第1段:交换机的启动Catalyst 1900 Management ConsoleCopyright (c) Cisco Systems, Inc. 1993-1999All rights reserved.Emter[rose Edotopm SoftwareEthernet Address: 00-04-DD-4E-9C-80PCA Number: 73-3122-04PCA Serial Number: FAB0503D0B4Model Number: WS-C1912-ENSystem Serial Number: FAB0503W0FAPower Supply S/N PHI044207FRPCB Serial Number: FAB0503D0B4,73-3122-041 user(s)now active on Management Console.User Interface Menu[M] Menus[K] Command Line[1] IP Configuration[P] Console PasswordEnter Selection:第2段:进行交换机基本配置Enter Selection: KCLI session with the switch is open.To end the CLI session, enter [Exit].>?Exec commands:enable Turn on privileged commandsexit Exit from the EXEChelp Description of the interactive help systemping Send echo messagessession Tunnel to moduleshow Show running system informationterminal Set terminal line parameters>enable##conftEnter configuration commands, one per line. End with CNTL/Z (config)#?Configure commands:address-violation Set address violation actionback-pressure Enable back pressurebanner Define a login bannerbridge-group Configure port grouping using bridge groupscdp Global CDP configuration subcommandscgroup Enable CGMPcluster Cluster configuration commandsecc Enable enhanced congestion controlenable Modift enable password parametersend Exit from configure modeexit Exit from configure modehelp Description of the interactive help systemhostname Set the system's network nameinterface Select an interface to configureip Global IP configureation subcommandsline Configure a terminal linelogin Configure options for logging inmac-address-table Configure the mac address tablemonitor-port Set port monitoring--More--mlilticast-store-and-forward Enables multicast store and forward network-port Set the network portno Negate a cominand or set its defaultsport-channel Configure Fast EtherChannelrip Routing information protocol configurationservice Configuration Commandsump-server Modify SNMP parametersspantree Spanning subsystemspantree-template Set bridge template parameterstorm-control Configure broadcast storm contfolpirameters switching-mode Set the switching modetacacs-server Modify TACACS query parameterstftp Configure TFTPuplink-fast Enable Uplink fastvlan VLAN configurationvlan-membership VLAN membership server configurationvtp Global VTP configuration commands(config)#SiostBiame SW1912SW1912(config)#enabSe password ?level Set exec level passwordSW1912(config)#enable password level 1 pass1SW1912(config)#enabSe password level 15 passl5SW1912(config)#enable secret CiscoSW1912#disableSW1912>SW1912>enEnter password: ***** ( 键入cisco )SW1912#conf tEnter configuration commands, one per line. End with CNTL/Z SW1912(config)#ip address 192.168.1.1255.255.255.0SW1912(config)#ip default-gateway 192.168.1.254SW1912(config)#ip domain-name ?WORD Domain nameSW1912(config)#ip domain-name SW1912(config)#ip name-server 200.1.1.1SW1912(config)#endSW1912#sh versionCisco Catalyst 1900/2820 Enterprise Edition Software Version V9.00,05 written from 192.168.000.005Copyright (c) Cisco Systems, Inc. 1993-1999SW1912 uptime is 0day(s)00hour(s)12minute(s)44secibd(s)cisco Catalyst 1900(486sxl)processor with 2048K/1024K bytes of memory Hardware board revision is 5Upgrade Status: No upgrade currently in progress.Config File Status: No configuration upload/download is in progress 15 Fixed Ethernet/IEEE802.3interface(s)Base Ethernet Address: 00-04-DD-4E-9C-80SW1912#show ipIP Address:192.168.1.1Subnet Mask:255.255.255.0Default Gateway:192.168.1.254Management VLANl: 1Domain name:Name server1:200.1.1.1HTTP server:EnabledHTTP port: 80RIP:EnabledSW1912#show running-configBuilding configuration...Current configuration:!tftp accepttftp server "192.168.0.5"tftp filename "catl900EN.9.00.05.bin"!hostname "SW1912"!ip address 192.168.1.1255.255.255.0ip default-gateway 192.168.1.254ip domain-name ""ip name-server 200.1.1.1!enable secret 5 $l$FMFQ$mlNHW7EzaJpG9uhKPWBvf/enable password level 1 "PASS 1"enable password level 15 "PASS 15"!interface Ethernet 0/1!interface Ethernet 0/2!interface Ethernet 0/3!interface Ethernet 0/4!interface Ethernet 0/5!interface Ethernet 0/6!interface Ethernet 0/7!interface Ethernet 0/8!interface Ethernet 0/9interface Ethernet 0/10!interface Ethernet 0/11!interface Ethernet 0/12!interface Ethernet 0/25!interface FastEthernet 0/26!interface FastEthernet 0/27!line consoleendSW1912#show int e0/lEthernet 0/1 is Suspended-no-linkbeat802.1 dSTP State: Forwarding Forward Transitions:1Port monitoring: DisabledUnknown unicast flooding: EnabledUnregistered multicast flooding: EnabledDescription:Duplex setting: Half duplexBack pressure: DisabledReceive Statistics Transmit StatisticsTotal good frames 0 Total frames 0Total octets 0 Total octets 0Broadcast/multicast frames 0 Broadcast/multicast frames 0Broadcast/multicast octets 0 Broadcast/multicast octets 0Good frames forwarded 0 Deferrals 0Frames filtered 0 Single collisions 0Runt frames 0 Multiple collisions 0No buffer discards 0 Excessive collisions 0Queue full discards 0Errors: Errors:第3段:重新启动交换机查看配置保持情况SW1912#reloadThis command resets the switch. All configured system parameters and static addresses will be retained. All dynamic addresses well be removed. Reset system, [Y]es or [N]o? YesCatalyst 1900 Management ConsoleCopyright (c) Cisco Systems, Inc. 1993-1999All rights reserved.Enterprise Edition SoftwareEthernet Address: 00-04-DD-4E-9C-80PCA Number: 73-3122-04PCA Serial Number: FAB0503D0B4Model Number: WS-C 1912-ASystem Serial Number: FAB0503W0FAPower Supply S/N: PH1044207FRPCB Serial Number: FAB0503DOB4,73-3122-04----------------------1 user(s) now active on Management Console.User Interface Menu[M]Menus[K]Command LineEnter Selection: KEnter password: *****CLI session with the switch is open.To end the CLI session, enter [Exit].SW1912>enableEnter password: ***** (键入cisco )SW1912#show running-config…(与第2段中配置清单相同,此处省略)(1)第1段是1912交换机加电后出现的显示内容,依次列出了版权信息、软件版本信息(企业版)、以太网地址(00.04,DD-4E-9C.80)以及各种序列号。
思科交换机基本配置实例讲解目录1、基本概念介绍 (2)2、密码、登陆等基本配置 (2)3、CISCO设备端口配置详解 (8)4、VLAN的规划及配置 (13)4.1核心交换机的相关配置 (13)4.2接入交换机的相关配置 (25)5、配置交换机的路由功能 (30)6、配置交换机的DHCP功能 (31)7、常用排错命令 (32)1、基本概念介绍IOS: 互联网操作系统,也就是交换机和路由器中用的操作系统VLAN: 虚拟lanVTP: VLAN TRUNK PROTOCOLDHCP: 动态主机配置协议ACL:访问控制列表三层交换机:具有三层路由转发能力的交换机本教程中“#”后的蓝色文字为注释内容。
2、密码、登陆等基本配置本节介绍的内容为cisco路由器或者交换机的基本配置,在目前版本的cisco交换机或路由器上的这些命令是通用的。
本教程用的是cisco的模拟器做的介绍,一些具体的端口显示或许与你们实际的设备不符,但这并不影响基本配置命令的执行。
Cisco 3640 (R4700) processor (revision 0xFF) with 124928K/6144K bytes of memory. Processor board ID 00000000R4700 CPU at 100MHz, Implementation 33, Rev 1.22 Ethernet interfaces8 Serial interfacesDRAM configuration is 64 bits wide with parity enabled.125K bytes of NVRAM.8192K bytes of processor board System flash (Read/Write)--- System Configuration Dialog ---Would you like to enter the initial configuration dialog? [yes/no]: n# 此处我们选择no,不进入他的初始化配置向导Press RETURN to get started!# 选择no以后,提示你按回车键开始,此处我们需要按回车键*Mar 1 00:43:56.591: %IP-5-WEBINST_KILL: Terminating DNS process*Mar 1 00:43:58.379: %SYS-5-RESTART: System restarted --Cisco IOS Software, 3600 Software (C3640-JK9O3S-M), Version 12.3(14)T7, RELEASE SOFTWARE (fc2)Technical Support: /techsupportCopyright (c) 1986-2006 by Cisco Systems, Inc.Compiled Wed 22-Mar-06 21:46 by pwade*Mar 1 00:43:58.411: %SNMP-5-COLDSTART: SNMP agent on host Router is undergoing a cold startRouter># 等显示稳定后,出现最初的提示符,注意提示符是“>”,目前所处的状态称为用户模式。