IOS Commands Flashcards
Basics of IOS
line console 0
Global command that changes the context to console configuration mode.
line vty
Global command that changes the context to vty configuration mode for the range of vty lines listed in the command.
login
Line (console and vty) configuration mode. Tells IOS to prompt for a password (no username).
password
Line (console and vty) configuration mode. Lists the password required if the login command (with no other parameters) is configured.
interface
Global command that changes the context to interface mode - for example, interface FastEthernet 0/1
hostname
Global command that sets this switch’s host name, which is also used as the first part of the switch’s command prompt.
exit
Moves back to the next higher mode and goes back to enable mode from any of the configuration submodes.
Ctrl-Z
This is not a command, but rather a two-key combination that together do the same thing as the end command
end
Exits configuration mode and goes back to enable mode from any of the configuration submodes.
no debug all
undebug all
Enable mode EXEC command to disable all currently enabled debugs.
terminal monitor
EXEC command that tells Cisco IOS to send a copy of all syslog messages, including debug messages, to the Telnet or SSH user who issues this command.
reload
Enable mode EXEC command that reboots the switch or router.
copy
Enable mode EXEC command that copies files from one file location to another. Locations include the startup config and running config in RAM, files TFTP and RCP servers, and flash memory.
copy running-config startup-config
Enable mode EXEC command that saves the active config, replacing the startup config file used when the switch initializes.
copy startup-config running-config
Enable mode EXEC command that merges the startup config file with the currently active running config file in RAM.
show running-config
Lists the contents of the running config file.
write erase
erase startup-config
These enable mode EXEC commands to erase the startup config file.
quit
EXEC command that disconnects the user from the CLI session.
show startup-config
Lists the contents of the startup config (initial config) file.
enable
Moves the user from user mode to enable (privileged) mode and prompts for a password if one is configured.
disable
Moves the user from enable mode to user mode.
configure terminal
Enable mode command that moves the user into configuration mode.
login local
Console and vty configuration mode. Tells IOS to prompt for a username and password, to be checked against locally configured username global configuration commands on this switch or router.
username secret
Global command. Defines one of possibly multiple usernames and associated passwords, used for user authentication. Used when the login local line configuration command has been used.
crypto key generate rsa
Global command. Creates and stores (in a hidden location in flash memory) the keys required by SSH.
transport input {telnet | ssh | all | none}
vty line configuration mode. Defines whether Telnet and/or SSH access is allowed into this switch. both values can be configured on one command to allow both Telnet and SSH access (the default).
service password-encryption
Global command that (weakly) encrypts passwords defined by the “username password”, “enable password”, and “login” commands.
interface vlan
Changes the context to VLAN interface mode. For VLAN1, allows the configuration of the switch’s IP address.
ip address
VLAN interface mode. Statically configures the switch’s IP address and mask.
ip address dhcp
VLAN interface mode. Configures the switch as a DHCP client to discover its IP address, mask, and default gateway.
ip default-gateway <address>
Global command, Configures the switch’s default gateway IP address. Not required if the switch uses DHCP.
ip name-server
Global command. Configures the IP address(es) of DNS servers, so any commands when logged into the switch will use the DNS for name resolution.
interface
Changes context to interface mode. The type is typically FastEthernet or GigabitEthernet. The possible port numbers vary depending on the model of switch - for example, Fa0/1, Fa0/2, and so on.
interface range
Changes the context to interface mode for a range of consecutively numbered interfaces. The sub-commands that follow then apply to all interfaces in the range.
shutdown
no shutdown
Interface mode. Disables or enables the interface, respectively.
speed {10 | 100 | 1000 | auto}
Interface mode. Manually sets the speed to the listed speed or, with the auto setting, automatically negotiates the speed.
duplex {auto | full | half}
Interface mode. Manually sets the duplex to half or full, or to auto-negotiate the duplex setting.
description
Interface mode. Lists any information text that the engineer wants to track for the interface, such as the expected device on the other end of the cable.
switchport mode {access | trunk | negotiate}
Interface configuration mode command that tells the switch to always be an access port, or always be a trunk port, or to negotiate which to be.
switchport port-security mac-address
Interface configuration mode command that statically adds a specific Mac address as an allowed MAC address on the interface.
switchport port-security mac-address sticky
Interface sub-command that tells the switch to learn MAC addresses on the interface and add them to the configuration for the interface as secure MAC addresses.
switchport port-security maximum
Interface sub-command that sets the maximum number of static secure MAC addresses that can be assigned to a single interface.
switchport port-security violation {protect | restrict | shutdown}
Interface sub-command that tells the switch what to do if an inappropriate MAC address tries to access the network through a secure switch port.
hostname
Global command. Sets this switch’s host name, which is also used as the first part of the switch’s command prompt.
enable secret
Global command. Sets this switch’s password that is required for any user to reach enable mode.
history size
Line config mode. Defines the number of commands held in the history buffer, for later recall, for users of those lines.
logging synchronous
Console or vty mode. Tells IOS to send log messages to the user at natural break points between commands, rather than in the middle of a line of output.
[no] logging console
Global command that disables or enables the display of log messages to the console.
exec-timeout
Consoles or vty mode. Sets the inactivity timeout, so that after the defined period of no action, IOS closes the current user login session.
switchport access vlan
Interface sub-command that defines the VLAN in which the interface resides.