第二章交换机和路由器简单配置配置方式EXEC模式用户模式•对交换机和路由器的有限操作•命令提示符为主机名主要有两个命令模式提供命令键入.模式一:EXEC模式(续)特权(或enabled)模式•对交换机和路由器更深入的操作•有配置和监视权力•是进入其它配置模式的前提•命令提示符为主机名#模式二(也是最常用的模式):Catalyst2950Switch启动界面---SystemConfigurationDialog---Atanypointyoumayenteraquestionmark'?'forhelp.Usectrl-ctoabortconfigurationdialogatanyprompt.Defaultsettingsareinsquarebrackets'[]'.Continuewithconfigurationdialog?[yes/no]:yesEnterIPaddress:ip_addressEnterIPnetmask:ip_netmaskWouldyouliketoenteradefaultgatewayaddress?[yes]:yesIPaddressofthedefaultgateway:ip_addressEnterahostname:host_nameEnterenablesecret:secret_passwordWouldyouliketoconfigureaTelnetpassword?[yes]yesEnterTelnetpassword:telnet_passwordWouldyouliketoenableasaclustercommandswitch?noEnterclustername:cls_nameLoggingIntotheSwitchandEnteringtheEnablePasswordConfigurationModes:•Globalconfigurationmode–wg_sw_a#configureterminal–wg_sw_a(config)#•Interfaceconfigurationmode–wg_sw_a(config)#interfacee0/1–wg_sw_a(config-if)#ConfiguringtheSwitch•SetsthelocalidentityfortheswitchConfiguringSwitchIdentification配置交换机的管理IP地址SW2950(config)#interfacevlan1SW2950(config-if)#ipaddress10.1.1.1255.255.255.0SW2950(config-if)#noshutdown配置交换机的网关Switch(config)#ipdefault-gateway{ipaddress}例如:SW2950(config)#ipdefault-gateway10.1.1.254ConfiguringtheSwitchIPAddressShowingSwitchInitialStartupStatuswg_sw_a#showversion•Displaystheconfigurationofthesystemhardware,softwareversion,namesandsourcesofconfigurationfiles,andbootimageswg_sw_a#showrunning-configuration•Displaystheswitch’scurrentactiveconfigurationfilewg_sw_a#showinterfaces•DisplaysstatisticsforallinterfacesconfiguredontheswitchSwitchshowversionCommandsw2950#showversionCiscoInternetworkOperatingSystemSoftwareIOS(tm)C2950Software(C2950-I6Q4L2-M),Version12.1(14)EA1a,RELEASESOFTWARE(fc1)Copyright(c)1986-2003byciscoSystems,Inc.CompiledTue02-Sep-0303:33byantoninoImagetext-base:0x80010000,data-base:0x805C0000ROM:BootstrapprogramisCALHOUNbootloadersw2950uptimeis1minuteSystemreturnedtoROMbypower-onSystemimagefileisflash:/c2950-i6q4l2-mz.121-14.EA1a.binciscoWS-C2950-24(RC32300)processorwith20710Kbytesofmemory.Lastresetfromsystem-resetRunningStandardImage24FastEthernet/IEEE802.3interface(s)32Kbytesofflash-simulatednon-volatileconfigurationmemory.BaseethernetMACAddress:00:0F:72:DB:4E:C0Motherboardserialnumber:FOC0813Y1H6Configurationregisteris0xFsw2950#showinterfacesfastEthernet0/1FastEthernet0/1isdown,lineprotocolisdown(notconnect)HardwareisFastEthernet,addressis000f.72db.4ec1(bia000f.72db.4ec1)MTU1500bytes,BW10000Kbit,DLY1000usec,reliability255/255,txload1/255,rxload1/255EncapsulationARPA,loopbacknotsetKeepaliveset(10sec)Auto-duplex,Auto-speedinputflow-controlisoff,outputflow-controlisoffARPtype:ARPA,ARPTimeout04:00:00Lastinputnever,output00:14:53,outputhangnever--More--SwitchshowinterfacesCommand路由器的简单配置-任何时侯按Ctrl+C推出对话模式Router#setup---SystemConfigurationDialog---Continuewithconfigurationdialog?[yes/no]:yesAtanypointyoumayenteraquestionmark'?'forhelp.Usectrl-ctoabortconfigurationdialogatanyprompt.Defaultsettingsareinsquarebrackets'[]'.Basicmanagementsetupconfiguresonlyenoughconnectivityformanagementofthesystem,extendedsetupwillaskyoutoconfigureeachinterfaceonthesystemWouldyouliketoenterbasicmanagementsetup?[yes/no]:no出厂时的缺省配置SetupInterfaceSummaryFirst,wouldyouliketoseethecurrentinterfacesummary?[yes]:InterfaceIP-AddressOK?MethodStatusProtocolBRI0unassignedYESunsetadministrativelydowndownBRI0:1unassignedYESunsetadministrativelydowndownBRI0:2unassignedYESunsetadministrativelydowndownEthernet0unassignedYESunsetadministrativelydowndownSerial0unassignedYESunsetadministrativelydowndownInterfacesFoundDuringStartupSetupInitialGlobalParametersConfiguringglobalparameters:Enterhostname[Router]:wg_ro_cTheenablesecretisapasswordusedtoprotectaccesstoprivilegedEXECandconfigurationmodes.Thispassword,afterentered,becomesencryptedintheconfiguration.Enterenablesecret:ciscoTheenablepasswordisusedwhenyoudonotspecifyanenablesecretpassword,withsomeoldersoftwareversions,andsomebootimages.Enterenablepassword:sanfranThevirtualterminalpasswordisusedtoprotectaccesstotherouteroveranetworkinterface.Entervirtualterminalpassword:sanjoseConfigureSNMPNetworkManagement?[no]:SetupInitialProtocolConfigurationsConfigureLAT?[yes]:noConfigureAppleTalk?[no]:ConfigureDECnet?[no]:ConfigureIP?[yes]:ConfigureIGRProuting?[yes]:noConfigureRIProuting?[no]:ConfigureCLNS?[no]:ConfigureIPX?[no]:ConfigureVines?[no]:ConfigureXNS?[no]:ConfigureApollo?[no]:SetupInterfaceParametersBRIinterfaceneedsisdnswitch-typetobeconfiguredValidswitchtypesare:[0]none..........Onlyifyoudon'twanttoconfigureBRI.[1]basic-1tr6....1TR6switchtypeforGermany[2]basic-5ess....AT&T5ESSswitchtypefortheUS/Canada[3]basic-dms100..NorthernDMS-100switchtypeforUS/Canada[4]basic-net3....NET3switchtypeforUKandEurope[5]basic-ni......NationalISDNswitchtype[6]basic-ts013...TS013switchtypeforAustralia[7]ntt...........NTTswitchtypeforJapan[8]vn3...........VN3andVN4switchtypesforFranceChooseISDNBRISwitchType[2]:Configuringinterfaceparameters:DoyouwanttoconfigureBRI0(BR