Home > Cisco > Switch > Cisco 2960 X Owners Manual

Cisco 2960 X Owners Manual

    Download as PDF Print this page Share this page

    Have a look at the manual Cisco 2960 X Owners Manual online for free. It’s possible to download the document as PDF or print. UserManuals.tech offer 53 Cisco manuals and user’s guides for free. Share the user manual or guide on Facebook, Twitter or Google+.

    							CHAPTER 1
    Using the Command-Line Interface
    Thischaptercontainsthefollowingtopics:
    •InformationAboutUsingtheCommand-LineInterface,page1
    •HowtoUsetheCLItoConfigureFeatures,page5
    Information About Using the Command-Line Interface
    ThissectiondescribestheCiscoIOScommand-lineinterface(CLI)andhowtouseittoconfigureyourswitch.
    Command Modes
    TheCiscoIOSuserinterfaceisdividedintomanydifferentmodes.Thecommandsavailabletoyoudepend
    onwhichmodeyouarecurrentlyin.Enteraquestionmark(?)atthesystemprompttoobtainalistofcommands
    availableforeachcommandmode.
    YoucanstartaCLIsessionthroughaconsoleconnection,throughTelnet,aSSH,orbyusingthebrowser.
    Whenyoustartasession,youbegininusermode,oftencalleduserEXECmode.Onlyalimitedsubsetof
    thecommandsareavailableinuserEXECmode.Forexample,mostoftheuserEXECcommandsareone-time
    commands,suchasshowcommands,whichshowthecurrentconfigurationstatus,andclearcommands,
    whichclearcountersorinterfaces.TheuserEXECcommandsarenotsavedwhentheswitchreboots.
    Tohaveaccesstoallcommands,youmustenterprivilegedEXECmode.Normally,youmustenterapassword
    toenterprivilegedEXECmode.Fromthismode,youcanenteranyprivilegedEXECcommandorenter
    globalconfigurationmode.
    Usingtheconfigurationmodes(global,interface,andline),youcanmakechangestotherunningconfiguration.
    Ifyousavetheconfiguration,thesecommandsarestoredandusedwhentheswitchreboots.Toaccessthe
    variousconfigurationmodes,youmuststartatglobalconfigurationmode.Fromglobalconfigurationmode,
    youcanenterinterfaceconfigurationmodeandlineconfigurationmode.
    Thistabledescribesthemaincommandmodes,howtoaccesseachone,thepromptyouseeinthatmode,and
    howtoexitthemode.
    Catalyst 2960-X Switch Network Management Configuration Guide, Cisco IOS Release 15.0(2)EX    
        OL-29044-011 
    						
    							Table 1: Command Mode Summary
    About This ModeExit MethodPromptAccess MethodMode
    Usethismodeto
    •Change
    terminal
    settings.
    •Performbasic
    tests.
    •Display
    system
    information.
    Enterlogoutor
    quit.Switch>Beginasession
    usingTelnet,SSH,
    orconsole.
    UserEXEC
    Usethismodeto
    verifycommands
    thatyouhave
    entered.Usea
    passwordtoprotect
    accesstothismode.
    Enterdisableto
    exit.Switch#WhileinuserEXEC
    mode,enterthe
    enablecommand.
    PrivilegedEXEC
    Usethismodeto
    configure
    parametersthat
    applytotheentire
    switch.
    Toexittoprivileged
    EXECmode,enter
    exitorend,orpress
    Ctrl-Z.
    Switch(config)#Whileinprivileged
    EXECmode,enter
    theconfigure
    command.
    Global
    configuration
    Usethismodeto
    configureVLAN
    parameters.When
    VTPmodeis
    transparent,youcan
    create
    extended-range
    VLANs(VLANIDs
    greaterthan1005)
    andsave
    configurationsinthe
    switchstartup
    configurationfile.
    Toexittoglobal
    configurationmode,
    entertheexit
    command.
    Toreturnto
    privilegedEXEC
    mode,pressCtrl-Z
    orenterend.
    Switch(config-vlan)#Whileinglobal
    configurationmode,
    enterthevlan
    vlan-idcommand.
    VLAN
    configuration
    Usethismodeto
    configure
    parametersforthe
    Ethernetports.
    Toexittoglobal
    configurationmode,
    enterexit.
    Toreturnto
    privilegedEXEC
    mode,pressCtrl-Z
    orenterend.
    Switch(config-if)#Whileinglobal
    configurationmode,
    entertheinterface
    command(witha
    specificinterface).
    Interface
    configuration
       Catalyst 2960-X Switch Network Management Configuration Guide, Cisco IOS Release 15.0(2)EX
    2OL-29044-01  
    Using the Command-Line Interface
    Command Modes 
    						
    							About This ModeExit MethodPromptAccess MethodMode
    LineconfigurationUsethismodeto
    configure
    parametersforthe
    terminalline.
    Toexittoglobal
    configurationmode,
    enterexit.
    Toreturnto
    privilegedEXEC
    mode,pressCtrl-Z
    orenterend.
    Switch(config-line)#Whileinglobal
    configurationmode,
    specifyalinewith
    thelinevtyorline
    consolecommand.
    Using the Help System
    Youcanenteraquestionmark(?)atthesystemprompttodisplayalistofcommandsavailableforeach
    commandmode.Youcanalsoobtainalistofassociatedkeywordsandargumentsforanycommand.
    SUMMARY STEPS
    1.help
    2.abbreviated-command-entry?
    3.abbreviated-command-entry
    4.?
    5.command?
    6.commandkeyword?
    DETAILED STEPS
    PurposeCommand or Action
    Obtainsabriefdescriptionofthehelpsysteminany
    commandmode.
    help
    Example:Switch#help
    Step 1
    Obtainsalistofcommandsthatbeginwithaparticular
    characterstring.
    abbreviated-command-entry?
    Example:Switch#di?dirdisabledisconnect
    Step 2
    Completesapartialcommandname.abbreviated-command-entry
    Example:Switch#shconfSwitch#showconfiguration
    Step 3
    Catalyst 2960-X Switch Network Management Configuration Guide, Cisco IOS Release 15.0(2)EX    
       OL-29044-013
    Using the Command-Line Interface
    Using the Help System 
    						
    							PurposeCommand or Action
    Listsallcommandsavailableforaparticularcommand
    mode.
    ?
    Example:Switch>?
    Step 4
    Liststheassociatedkeywordsforacommand.command?
    Example:Switch>show?
    Step 5
    Liststheassociatedargumentsforakeyword.commandkeyword?
    Example:Switch(config)#cdpholdtime?Lengthoftime(insec)thatreceiver
    Step 6
    mustkeepthispacket
    Understanding Abbreviated Commands
    Youneedtoenteronlyenoughcharactersfortheswitchtorecognizethecommandasunique.
    ThisexampleshowshowtoentertheshowconfigurationprivilegedEXECcommandinanabbreviatedform:
    Switch#showconf
    No and default Forms of Commands
    Almosteveryconfigurationcommandalsohasanoform.Ingeneral,usethenoformtodisableafeatureor
    functionorreversetheactionofacommand.Forexample,thenoshutdowninterfaceconfigurationcommand
    reversestheshutdownofaninterface.Usethecommandwithoutthekeywordnotoreenableadisabledfeature
    ortoenableafeaturethatisdisabledbydefault.
    Configurationcommandscanalsohaveadefaultform.Thedefaultformofacommandreturnsthecommand
    settingtoitsdefault.Mostcommandsaredisabledbydefault,sothedefaultformisthesameasthenoform.
    However,somecommandsareenabledbydefaultandhavevariablessettocertaindefaultvalues.Inthese
    cases,thedefaultcommandenablesthecommandandsetsvariablestotheirdefaultvalues.
    CLI Error Messages
    ThistablelistssomeerrormessagesthatyoumightencounterwhileusingtheCLItoconfigureyourswitch.
       Catalyst 2960-X Switch Network Management Configuration Guide, Cisco IOS Release 15.0(2)EX
    4OL-29044-01  
    Using the Command-Line Interface
    Understanding Abbreviated Commands 
    						
    							Table 2: Common CLI Error Messages
    How to Get HelpMeaningError Message
    Reenterthecommandfollowedby
    aquestionmark(?)withaspace
    betweenthecommandandthe
    questionmark.
    Thepossiblekeywordsthatyoucan
    enterwiththecommandappear.
    Youdidnotenterenough
    charactersforyourswitchto
    recognizethecommand.
    %Ambiguouscommand:"showcon"
    Reenterthecommandfollowedby
    aquestionmark(?)withaspace
    betweenthecommandandthe
    questionmark.
    Thepossiblekeywordsthatyoucan
    enterwiththecommandappear.
    Youdidnotenterallthekeywords
    orvaluesrequiredbythis
    command.
    %Incompletecommand.
    Enteraquestionmark(?)todisplay
    allthecommandsthatareavailable
    inthiscommandmode.
    Thepossiblekeywordsthatyoucan
    enterwiththecommandappear.
    Youenteredthecommand
    incorrectly.Thecaret(^)marksthe
    pointoftheerror.
    %Invalidinputdetectedat‘^’marker.
    Configuration Logging
    Youcanlogandviewchangestotheswitchconfiguration.YoucanusetheConfigurationChangeLogging
    andNotificationfeaturetotrackchangesonaper-sessionandper-userbasis.Theloggertrackseach
    configurationcommandthatisapplied,theuserwhoenteredthecommand,thetimethatthecommandwas
    entered,andtheparserreturncodeforthecommand.Thisfeatureincludesamechanismforasynchronous
    notificationtoregisteredapplicationswhenevertheconfigurationchanges.Youcanchoosetohavethe
    notificationssenttothesyslog.
    OnlyCLIorHTTPchangesarelogged.Note
    How to Use the CLI to Configure Features
    Configuring the Command History
    Thesoftwareprovidesahistoryorrecordofcommandsthatyouhaveentered.Thecommandhistoryfeature
    isparticularlyusefulforrecallinglongorcomplexcommandsorentries,includingaccesslists.Youcan
    customizethisfeaturetosuityourneeds.
    Catalyst 2960-X Switch Network Management Configuration Guide, Cisco IOS Release 15.0(2)EX    
       OL-29044-015
    Using the Command-Line Interface
    Configuration Logging 
    						
    							Changing the Command History Buffer Size
    Bydefault,theswitchrecordstencommandlinesinitshistorybuffer.Youcanalterthisnumberforacurrent
    terminalsessionorforallsessionsonaparticularline.Thisprocedureisoptional.
    SUMMARY STEPS
    1.terminalhistory[sizenumber-of-lines]
    DETAILED STEPS
    PurposeCommand or Action
    Changesthenumberofcommandlinesthattheswitchrecordsduring
    thecurrentterminalsessionintheprivilegedEXECmode.Youcan
    configurethesizefrom0through256.
    terminalhistory[sizenumber-of-lines]
    Example:Switch#terminalhistorysize200
    Step 1
    Recalling Commands
    Torecallcommandsfromthehistorybuffer,performoneoftheactionslistedinthistable.Theseactionsare
    optional.
    ThearrowkeysfunctiononlyonANSI-compatibleterminalssuchasVT100s.Note
    SUMMARY STEPS
    1.Ctrl-Porusetheuparrowkey
    2.Ctrl-Norusethedownarrowkey
    3.showhistory
    DETAILED STEPS
    PurposeCommand or Action
    Recallscommandsinthehistorybuffer,beginningwiththemostrecentcommand.
    Repeatthekeysequencetorecallsuccessivelyoldercommands.
    Ctrl-PorusetheuparrowkeyStep 1
    Returnstomorerecentcommandsinthehistorybufferafterrecallingcommands
    withCtrl-Portheuparrowkey.Repeatthekeysequencetorecallsuccessively
    morerecentcommands.
    Ctrl-NorusethedownarrowkeyStep 2
       Catalyst 2960-X Switch Network Management Configuration Guide, Cisco IOS Release 15.0(2)EX
    6OL-29044-01  
    Using the Command-Line Interface
    Configuring the Command History 
    						
    							PurposeCommand or Action
    ListsthelastseveralcommandsthatyoujustenteredinprivilegedEXECmode.
    Thenumberofcommandsthatappeariscontrolledbythesettingoftheterminal
    showhistory
    Example:Switch#showhistory
    Step 3
    historyglobalconfigurationcommandandthehistorylineconfiguration
    command.
    Disabling the Command History Feature
    Thecommandhistoryfeatureisautomaticallyenabled.Youcandisableitforthecurrentterminalsessionor
    forthecommandline.Thisprocedureisoptional.
    SUMMARY STEPS
    1.terminalnohistory
    DETAILED STEPS
    PurposeCommand or Action
    Disablesthefeatureduringthecurrentterminalsessioninthe
    privilegedEXECmode.
    terminalnohistory
    Example:Switch#terminalnohistory
    Step 1
    Enabling and Disabling Editing Features
    Althoughenhancededitingmodeisautomaticallyenabled,youcandisableit,andreenableit.
    SUMMARY STEPS
    1.terminalediting
    2.terminalnoediting
    DETAILED STEPS
    PurposeCommand or Action
    Reenablestheenhancededitingmodeforthecurrentterminal
    sessionintheprivilegedEXECmode.
    terminalediting
    Example:Switch#terminalediting
    Step 1
    Catalyst 2960-X Switch Network Management Configuration Guide, Cisco IOS Release 15.0(2)EX    
       OL-29044-017
    Using the Command-Line Interface
    Enabling and Disabling Editing Features 
    						
    							PurposeCommand or Action
    Disablestheenhancededitingmodeforthecurrentterminalsession
    intheprivilegedEXECmode.
    terminalnoediting
    Example:Switch#terminalnoediting
    Step 2
    Editing Commands through Keystrokes
    Thekeystrokeshelpyoutoeditthecommandlines.Thesekeystrokesareoptional.
    ThearrowkeysfunctiononlyonANSI-compatibleterminalssuchasVT100s.Note
    Table 3: Editing Commands
    DescriptionEditingCommands
    Movesthecursorbackonecharacter.Ctrl-Borusetheleftarrowkey
    Movesthecursorforwardonecharacter.Ctrl-Forusetherightarrowkey
    Movesthecursortothebeginningofthecommand
    line.
    Ctrl-A
    Movesthecursortotheendofthecommandline.Ctrl-E
    Movesthecursorbackoneword.EscB
    Movesthecursorforwardoneword.EscF
    Transposesthecharactertotheleftofthecursorwith
    thecharacterlocatedatthecursor.
    Ctrl-T
    Erasesthecharactertotheleftofthecursor.DeleteorBackspacekey
    Deletesthecharacteratthecursor.Ctrl-D
    Deletesallcharactersfromthecursortotheendof
    thecommandline.
    Ctrl-K
    Deletesallcharactersfromthecursortothebeginning
    ofthecommandline.
    Ctrl-UorCtrl-X
    Deletesthewordtotheleftofthecursor.Ctrl-W
       Catalyst 2960-X Switch Network Management Configuration Guide, Cisco IOS Release 15.0(2)EX
    8OL-29044-01  
    Using the Command-Line Interface
    Enabling and Disabling Editing Features 
    						
    							Deletesfromthecursortotheendoftheword.EscD
    Capitalizesatthecursor.EscC
    Changesthewordatthecursortolowercase.EscL
    Capitalizeslettersfromthecursortotheendofthe
    word.
    EscU
    Designatesaparticularkeystrokeasanexecutable
    command,perhapsasashortcut.
    Ctrl-VorEscQ
    Scrollsdownalineorscreenondisplaysthatare
    longerthantheterminalscreencandisplay.
    TheMorepromptisusedforanyoutputthat
    hasmorelinesthancanbedisplayedonthe
    terminalscreen,includingshowcommand
    output.YoucanusetheReturnandSpace
    barkeystrokeswheneveryouseetheMore
    prompt.
    Note
    Returnkey
    Scrollsdownonescreen.Spacebar
    Redisplaysthecurrentcommandlineiftheswitch
    suddenlysendsamessagetoyourscreen.
    Ctrl-LorCtrl-R
    Editing Command Lines That Wrap
    Youcanuseawraparoundfeatureforcommandsthatextendbeyondasinglelineonthescreen.Whenthe
    cursorreachestherightmargin,thecommandlineshiftstenspacestotheleft.Youcannotseethefirstten
    charactersoftheline,butyoucanscrollbackandcheckthesyntaxatthebeginningofthecommand.The
    keystrokeactionsareoptional.
    Toscrollbacktothebeginningofthecommandentry,pressCtrl-Bortheleftarrowkeyrepeatedly.Youcan
    alsopressCtrl-Atoimmediatelymovetothebeginningoftheline.
    ThearrowkeysfunctiononlyonANSI-compatibleterminalssuchasVT100s.Note
    Thefollowingexampleshowshowtowrapacommandlinethatextendbeyondasinglelineonthescreen.
    SUMMARY STEPS
    1.access-list
    2.Ctrl-A
    3.Returnkey
    Catalyst 2960-X Switch Network Management Configuration Guide, Cisco IOS Release 15.0(2)EX    
       OL-29044-019
    Using the Command-Line Interface
    Enabling and Disabling Editing Features 
    						
    							DETAILED STEPS
    PurposeCommand or Action
    Displaystheglobalconfigurationcommandentrythatextendsbeyond
    oneline.
    access-list
    Example:
    Switch(config)#access-list101permittcp
    Step 1
    Whenthecursorfirstreachestheendoftheline,thelineisshiftedten
    spacestotheleftandredisplayed.Thedollarsign($)showsthatthe
    linehasbeenscrolledtotheleft.Eachtimethecursorreachestheend
    oftheline,thelineisagainshiftedtenspacestotheleft.
    10.15.22.25255.255.255.010.15.22.35Switch(config)#$101permittcp10.15.22.25255.255.255.010.15.22.35255.25Switch(config)#$ttcp10.15.22.25255.255.255.0131.108.1.20255.255.255.0eqSwitch(config)#$15.22.25255.255.255.010.15.22.35255.255.255.0eq45
    Checksthecompletesyntax.Ctrl-AStep 2
    Example:Switch(config)#access-list101permittcp10.15.22.25255.255.255.010.15.2$
    Thedollarsign($)appearsattheendofthelinetoshowthattheline
    hasbeenscrolledtotheright.
    Executethecommands.ReturnkeyStep 3
    Thesoftwareassumesthatyouhaveaterminalscreenthatis80columns
    wide.Ifyouhaveadifferentwidth,usetheterminalwidthprivileged
    EXECcommandtosetthewidthofyourterminal.
    Uselinewrappingwiththecommandhistoryfeaturetorecalland
    modifypreviouscomplexcommandentries.
    Searching and Filtering Output of show and more Commands
    Youcansearchandfiltertheoutputforshowandmorecommands.Thisisusefulwhenyouneedtosort
    throughlargeamountsofoutputorifyouwanttoexcludeoutputthatyoudonotneedtosee.Usingthese
    commandsisoptional.
    SUMMARY STEPS
    1.{show|more}command|{begin|include|exclude}regular-expression
    DETAILED STEPS
    PurposeCommand or Action
    Searchesandfilterstheoutput.{show|more}command|{begin|include|exclude}
    regular-expression
    Step 1
       Catalyst 2960-X Switch Network Management Configuration Guide, Cisco IOS Release 15.0(2)EX
    10OL-29044-01  
    Using the Command-Line Interface
    Searching and Filtering Output of show and more Commands 
    						
    All Cisco manuals Comments (0)

    Related Manuals for Cisco 2960 X Owners Manual