Introduction to Networks v7.0
/ Basic Switch and End Device Conguration / The Command Structure
Introduction to Networks
1
The Command Structure
Networking Today
2.3.1
Basic Switch and End Device
2 Conguration
Basic IOS Command Structure
2.0 Introduction
2.1 Cisco IOS Access This topic covers the basic structure of commands for the Cisco IOS. A network administrator must know the basic IOS
command structure to be able to use the CLI for device conguration.
2.1.1 Operating Systems
A Cisco IOS device supports many commands. Each IOS command has a specic format, or syntax, and can only be executed in
the appropriate mode. The general syntax for a command, shown in the gure, is the command followed by any appropriate
2.1.2 GUI keywords and arguments.
2.1.3 Purpose of an OS
Switch>show ip protocols
2.1.4 Access Methods
2.1.5 Terminal Emulation Programs
Check Your Understanding - Cisco
2.1.6 Keyword or
IOS Access Prompt Command Space
Argument
2.2 IOS Navigation
2.2.1 Primary Command Modes
Conguration Mode and
Switch>ping 192.168.10.5
2.2.2
Subconguration Modes
Keyword - This is a specic parameter dened in the operating system (in the gure, ip protocols).
Video - IOS CLI Primary Command
2.2.3 Argument - This is not predened; it is a value or variable dened by the user (in the gure, 192.168.10.5).
Modes
After entering each complete command, including any keywords and arguments, press the Enter key to submit the command to
2.2.4 Navigate Between IOS Modes
the command interpreter.
Video - Navigate Between IOS
2.2.5
Modes
A Note About Syntax Checker
2.2.6 2.3.2
Activities
2.2.7
Syntax Checker - Navigate IOS Command Syntax Check
Between IOS Modes
Check Your Understanding - IOS
2.2.8
Navigation A command might require one or more arguments. To determine the keywords and arguments required for a command, refer to
the command syntax. The syntax provides the pattern, or format, that must be used when entering a command.
2.3 The Command Structure
As identied in the table, boldface text indicates commands and keywords that are entered as shown. Italic text indicates an
argument for which the user provides the value.
2.3.1 Basic IOS Command Structure
Convention Description
2.3.2 IOS Command Syntax Check
boldface Boldface text indicates commands and keywords that you enter literally as shown.
2.3.3 IOS Help Features italics Italic text indicates arguments for which you supply values.
[x] Square brackets indicate an optional element (keyword or argument).
Video - Context Sensitive Help
2.3.4
and Command Syntax Check {x} Braces indicate a required element (keyword or argument).
Braces and vertical lines within square brackets indicate a required choice within an optional element. Spaces
2.3.5 Hot Keys and Shortcuts [x {y | z }]
are used to clearly delineate parts of the command.
2.3.6 Video - Hot Keys and Shortcuts For instance, the syntax for using the description command is description string. The argument is a string value provided by the
user. The description command is typically used to identify the purpose of an interface. For example, entering the command,
description Connects to the main headquarter oce switch, describes where the other device is at the end of the connection.
2.3.7 Packet Tracer - Navigate the IOS
The following examples demonstrate conventions used to document and use IOS commands:
Lab - Navigate the IOS by Using
2.3.8
Tera Term for Console Connectivity
ping ip-address - The command is ping and the user-dened argument is the ip-address of the destination device. For
example, ping 10.10.10.5.
2.4 Basic Device Conguration traceroute ip-address - The command is traceroute and the user-dened argument is the ip-address of the destination
device. For example, traceroute 192.168.254.254.
2.5 Save Congurations
If a command is complex with multiple arguments, you may see it represented like this:
2.6 Ports and Addresses Switch(config-if)# switchport port-security aging { static | time time | type {absolute | inactivity}}
2.7 Congure IP Addressing The command will typically be followed with a detailed description of the command and each argument.
The Cisco IOS Command Reference is the ultimate source of information for a particular IOS command.
2.8 Verify Connectivity
2.9 Module Practice and Quiz
2.3.3
3 Protocols and Models
IOS Help Features
4 Physical Layer
The IOS has two forms of help available: context-sensitive help and command syntax check.
5 Number Systems Context-sensitive help enables you to quickly nd answers to these questions:
Which commands are available in each command mode?
6 Which commands start with specic characters or group of characters?
Data Link Layer
Which arguments and keywords are available to particular commands?
To access context-sensitive help, simply enter a question mark, ?, at the CLI.
7 Ethernet Switching
Command syntax check veries that a valid command was entered by the user. When a command is entered, the command line
interpreter evaluates the command from left to right. If the interpreter understands the command, the requested action is
8 Network Layer executed, and the CLI returns to the appropriate prompt. However, if the interpreter cannot understand the command being
entered, it will provide feedback describing what is wrong with the command.
9 Address Resolution
2.3.4
10 Basic Router Conguration
Video - Context Sensitive Help and Command Syntax
11 IPv4 Addressing
Check
12 IPv6 Addressing
Click Play in the gure to view a video demonstration of context-sensitive help and command syntax check.
13 ICMP
14 Transport Layer
15 Application Layer
Network Security
16
Fundamentals
17 Build a Small Network
4:02
2.3.5
Hot Keys and Shortcuts
The IOS CLI provides hot keys and shortcuts that make conguring, monitoring, and troubleshooting easier.
Commands and keywords can be shortened to the minimum number of characters that identify a unique selection. For example,
the congure command can be shortened to conf because congure is the only command that begins with conf. An even
shorter version, con, will not work because more than one command begins with con. Keywords can also be shortened.
The table lists keystrokes to enhance command line editing.
Keystroke Description
Tab Completes a partial command name entry.
Backspace Erases the character to the left of the cursor.
Ctrl+D Erases the character at the cursor.
Ctrl+K Erases all characters from the cursor to the end of the command line.
Esc D Erases all characters from the cursor to the end of the word.
Ctrl+U or Ctrl+X Erases all characters from the cursor back to the beginning of the command line.
Ctrl+W Erases the word to the left of the cursor.
Ctrl+A Moves the cursor to the beginning of the line.
Left Arrow or Ctrl+B Moves the cursor one character to the left.
Esc B Moves the cursor back one word to the left.
Esc F Moves the cursor forward one word to the right.
Right Arrow or Ctrl+F Moves the cursor one character to the right.
Ctrl+E Moves the cursor to the end of command line.
Recalls the previous command in the history buer, beginning with the most recent
Up Arrow or Ctrl+P
command.
Down Arrow or Ctrl+N Goes to the next line in the the history buer.
Ctrl+R or Ctrl+I or Ctrl+L Redisplays the system prompt and command line after a console message is received.
Note: While the Delete key typically deletes the character to the right of the prompt, the IOS command structure does not
recognize the Delete key.
When a command output produces more text than can be displayed in a terminal window, the IOS will display a “--More--”
prompt. The following table describes the keystrokes that can be used when this prompt is displayed.
Keystroke Description
Enter Key Displays the next line.
Space
Displays the next screen.
Bar
Ends the display string, returning to previous prompt.
Any other
* Except "y", which answers "yes" to the --More-- prompt, and acts like the
key *
Space bar
This table lists commands used to exit out of an operation.
Keystroke Description
When in any conguration mode, ends the conguration mode and returns to
Ctrl-C privileged EXEC mode. When in setup mode, aborts back to the command
prompt.
When in any conguration mode, ends the conguration mode and returns to
Introduction to Networks Ctrl-Z
privileged EXEC mode.
Ctrl- All-purpose break sequence used to abort DNS lookups, traceroutes, pings,
Shift-6 etc.
1 Networking Today
Basic Switch and End Device 2.3.6
2 Conguration
Video - Hot Keys and Shortcuts
2.0 Introduction
2.1 Cisco IOS Access Click Play in the gure to view a video demonstration of the various hotkeys and shortcuts.
2.1.1 Operating Systems
2.1.2 GUI
2.1.3 Purpose of an OS
2.1.4 Access Methods
2.1.5 Terminal Emulation Programs
Check Your Understanding - Cisco
2.1.6
IOS Access
2.2 IOS Navigation
2.2.1 Primary Command Modes
Conguration Mode and
2.2.2
Subconguration Modes
Video - IOS CLI Primary Command
6:02
2.2.3
Modes
2.2.4 Navigate Between IOS Modes
2.3.7
Video - Navigate Between IOS
2.2.5
Modes Packet Tracer - Navigate the IOS
A Note About Syntax Checker
2.2.6
Activities
In this activity, you will practice skills necessary for navigating the Cisco IOS, including dierent user access modes, various
Syntax Checker - Navigate
2.2.7 conguration modes, and common commands used on a regular basis. You will also practice accessing the context-sensitive
Between IOS Modes
help by conguring the clock command.
Check Your Understanding - IOS
2.2.8
Navigation
Navigate the IOS
2.3 The Command Structure
Navigate the IOS
2.3.1 Basic IOS Command Structure
2.3.2 IOS Command Syntax Check
2.3.8
2.3.3 IOS Help Features
Lab - Navigate the IOS by Using Tera Term for Console
2.3.4
Video - Context Sensitive Help
and Command Syntax Check
Connectivity
2.3.5 Hot Keys and Shortcuts
In this lab, you will complete the following objectives:
2.3.6 Video - Hot Keys and Shortcuts
Part 1: Access a Cisco Switch through the Serial Console Port
Part 2: Display and Congure Basic Device Settings
2.3.7 Packet Tracer - Navigate the IOS Part 3: (Optional) Access a Cisco Router Using a Mini-USB Console Cable
Lab - Navigate the IOS by Using
2.3.8
Tera Term for Console Connectivity Navigate the IOS by Using Tera Term for Console Connectivity
2.4 Basic Device Conguration
2.2 2.4
2.5 Save Congurations IOS Navigation Basic Device Conguration
2.6 Ports and Addresses
2.7 Congure IP Addressing
2.8 Verify Connectivity
2.9 Module Practice and Quiz
3 Protocols and Models
4 Physical Layer
5 Number Systems
6 Data Link Layer
7 Ethernet Switching
8 Network Layer
9 Address Resolution
10 Basic Router Conguration
11 IPv4 Addressing
12 IPv6 Addressing
13 ICMP
14 Transport Layer
15 Application Layer
Network Security
16
Fundamentals
17 Build a Small Network