Configure IP Address Settings on a Switch using the CLI - Cisco

文章推薦指數: 80 %
投票人數:10人

The switch can have multiple IP addresses. Each IP address can be assigned to specified interfaces or ports, Link Aggregation Groups (LAGs), ... Skiptocontent Skiptosearch Skiptofooter SupportProductSupportSwitchesCisco350SeriesManagedSwitchesConfigurationExamplesandTechNotes ConfigureIPAddressSettingsonaSwitchusingtheCLI Save LogintoSaveContent Translations Download Print AvailableLanguages DownloadOptions PDF (252.6KB) ViewwithAdobeReaderonavarietyofdevices ePub (348.7KB) ViewinvariousappsoniPhone,iPad,Android,SonyReader,orWindowsPhone Mobi(Kindle) (302.1KB) ViewonKindledeviceorKindleapponmultipledevices Updated:June28,2021 DocumentID:SMB5557 Bias-FreeLanguage Bias-FreeLanguage Thedocumentationsetforthisproductstrivestousebias-freelanguage.Forthepurposesofthisdocumentationset,bias-freeisdefinedaslanguagethatdoesnotimplydiscriminationbasedonage,disability,gender,racialidentity,ethnicidentity,sexualorientation,socioeconomicstatus,andintersectionality.Exceptionsmaybepresentinthedocumentationduetolanguagethatishardcodedintheuserinterfacesoftheproductsoftware,languageusedbasedonRFPdocumentation,orlanguagethatisusedbyareferencedthird-partyproduct.LearnmoreabouthowCiscoisusingInclusiveLanguage. kmgmt3029-Upgrade-Firmware-Cisco-Business-Mobile-app Objective TheswitchcanhavemultipleIPaddresses.EachIPaddresscanbeassignedtospecified interfacesorports,LinkAggregationGroups(LAGs),orVirtualLocalAreaNetworks(VLANs).Toremotelymanage thedevice,anIPaddressmustbedefinedtoaccesstheswitch.Thisallowsyoutoeasilyconfigureor troubleshootthedevicethroughtheweb-basedutility,Telnet,orSecureShell(SSH). TheIPaddressoftheswitchcanbemanuallyconfiguredorautomaticallyreceivedfrom aDynamicHostConfigurationProtocol(DHCP)server.IftherearenoDHCPserversavailable,theswitchwilluse itsfactorydefaultIPaddresswhichis192.168.1.254. ThisarticleprovidesinstructionsonhowtoconfiguretheIPaddresssettingsofyour switchthroughtheCommandLineInterface(CLI). Ifyouareunfamiliarwithtermsinthisdocument,checkoutCiscoBusiness:GlossaryofNewTerms. ApplicableDevices Sx350Series SG350XSeries Sx500Series Sx550XSeries SoftwareVersion 1.4.7.05—Sx500 2.2.8.4—Sx350,SG350X,Sx550X ConfiguretheIPAddressoftheSwitchthroughtheCLI Important:IfyourswitchisinoneofthestackingmodeswithaStandbySwitch present,itisrecommendedtoconfigureastaticIPaddresstopreventdisconnectingfromthenetworkduringa StackingActiveswitchover.Thisisbecausewhenthestandbyswitchtakescontrolofthestack,whenusingDHCP, itmightreceiveadifferentIPaddressthantheonethatwasreceivedbytheoriginalactive-enabledunitof thestack. StaticIPAddress DHCPIPAddress ConfigureStaticIPAddress Inthisscenario,theswitchissetupwithouttheavailabilityofaDHCPserver. FollowthestepsbelowtoconfigureastaticIPaddressontheswitch: Step1.Connectyourcomputerdirectlytotheswitchusingaserialcable. IfyouwouldprefertoSSHintoyourswitch,click heretoviewanarticleongainingCLIaccesstoaswitch. Step2.Logintotheswitchconsole.Thedefaultusernameandpasswordiscisco/cisco. Ifyouhaveconfiguredanewusernameorpassword,enterthecredentialsinstead. Inthisexample,SG350X-2424-PortGigabitStackableManagedSwitchis used. Step3.FromthePrivilegedEXECmodeoftheswitch,entertheGlobalConfiguration modebyenteringthefollowing: SG350X#configure Theconfigurecommandisequivalenttoconfigureterminal Step4.IntheGlobalConfigurationmode,entertheinterfacecontextbyenteringthe following: SG350X(config)#interface[interface-id|vlan-id Inthisexample,interfacevlan1isused.VLAN1isthedefaultVLANof theswitch. Step5.EntertheIPaddressinterfaceconfigurationcommandtodefineanIPaddress foraninterfacebyenteringeitherofthefollowing: ipaddress[ip-address]{{mask|prefix-length}}—Usethereloadcommandto reloadtheswitchimmediately. ipaddress[ip-address]{{mask|prefix-length}}[default-gateway-ip-address] —Usethereload{{inhhh:mm|mmm|athh:mm[daymonth]}}commandtospecifyscheduledswitchreload. Theoptionsare: ipaddress—SpecifiestheIPaddress. mask—SpecifiesthenetworkmaskoftheIPaddress. prefix-length—SpecifiesthenumberofbitsthatcomprisetheIPaddressprefix.The prefixlengthmustbe precededbyaforwardslash(/).Therangeis8to30. SG350X(config-if)#ipaddress192.168.100.201255.255.255.0 Inthisexample,theIPaddressusedis192.168.100.201with255.255.255.0 asmask. Step6.(Optional)ToremoveanIPaddressfromaninterface,usethenoformoftheIP addresscommandbyenteringthefollowing: SG350X(config-if)#noipaddress Step7.EntertheendcommandtogobacktothePrivilegedEXECmodeoftheswitch. SG350X(config-if)#end Step8.(Optional)TodisplaytheIPaddressconfigurationandinformationonthe interface,enterthefollowingcommandinthePrivilegedEXECmode: SG350X#showipinterface Inthisexample,theIPaddressis192.168.100.201andtheTypeisStatic. Step9.(Optional)Tosavetheconfiguredsettingstothestartupconfigurationfile, enterthefollowing: SG350X#copyrunning-configstartup-config Step10.(Optional)PressYforYesorNforNoonyourkeyboardoncethe Overwritefile[startup-config]…promptappears. Inthisexample,Yispressed. YoushouldnowhavesuccessfullyconfiguredthestaticIPaddresssettingsofyour switch. ConfiguretheIPAddressthroughDHCP Inthisscenario,theswitchisconnectedtoarouterwhichactsasanactiveDHCP server.FollowthestepsbelowtoconfiguretheIPaddressoftheswitchthroughDHCP. Step1.Connectyourcomputerdirectlytotheswitchusingaserialcable. Step2.Logintotheswitchconsole.Thedefaultusernameandpasswordiscisco/cisco. Ifyouhaveconfiguredanewusernameorpassword,enterthecredentialsinstead. Inthisexample,SG350X-2424-PortGigabitStackableManagedSwitchis used. Step3.FromthePrivilegedEXECmodeoftheswitch,entertheGlobalConfiguration modebyenteringthefollowing: SG350X#configure Step4.IntheGlobalConfigurationmode,entertheinterfacecontextbyenteringthe following: SG350X(config)#interface[interfaceid|vlan-id] Inthisexample,interfacevlan1isused.VLAN1isthedefaultVLANof theswitch. Step5.Intheinterfacecontext,acquireanIPaddressfromtheDHCPserverby enteringthefollowing: SG350X(config-if)#interface[interfaceid|vlan-id] Youwillreceiveanotificationthatthedevicehasbeenconfiguredonthespecified interface. Step6.(Optional)ToremoveanIPaddressfromaninterface,usethenoformoftheIP addressDHCPcommandbyenteringthefollowing: SG350X(config-if)#noipaddressdhcp Step7.EntertheendcommandtogobacktothePrivilegedEXECmodeoftheswitch. SG350X(config-if)#end Step8.(Optional)TodisplaytheIPaddressconfigurationandinformationofthe interface,enterthefollowingcommandinthePrivilegedEXECmode: SG350X#showipinterface Inthisexample,theIPaddressis192.168.100.103andtheTypeisDHCP. Step9.(Optional)TodisplaytheIPaddressconfigurationandinformationontheDHCP clientinterface,enterthefollowingcommandinthePrivilegedEXECmode: SG350X#showipdhcpclientinterface Step10.(Optional)Tosavetheconfiguredsettingstothestartupconfigurationfile, enterthefollowing: SG350X#copyrunning-configstartup-config Step11.(Optional)PressYforYesorNforNoonyourkeyboardoncethe Overwritefile[startup-config]…promptappears. Inthisexample,Yispressed. YoushouldnowhavesuccessfullyconfiguredtheDHCPIPaddresssettingsonyour switch. RevisionHistory Revision PublishDate Comments 1.0 13-Dec-2018 InitialRelease WasthisDocumentHelpful? Yes No Feedback ContactCisco OpenaSupportCase (RequiresaCiscoServiceContract) ©2022Ciscoand/oritsaffiliates.Allrightsreserved.



請為這篇文章評分?