754 words
4 minutes
Help, autocompletion, monitoring, shortcuts
2021-09-14
2025-01-12

Help#

The option that displays the available options for a command is ?

Router#show ?
aaa Show AAA values
access-lists List access lists
arp Arp table
cdp CDP information
class-map Show QoS Class Map
clock Display the system clock
controllers Interface controllers status
crypto Encryption module
debugging State of each debugging option
dhcp Dynamic Host Configuration Protocol status
dot11 IEEE 802.11 show information
file Show filesystem information
flash: display information about flash: file system
flow Flow information
frame-relay Frame-Relay information
history Display the session command history
hosts IP domain-name, lookup style, nameservers, and host table
interfaces Interface status and configuration
ip IP information
ipv6 IPv6 information
license Show license information
line TTY line information
--More--

Here the ? shows the possible commands with show.

  • The --More-- indicates that there are too many commands for the display window.
  • The Enter key scrolls line by line.
  • The Space key scrolls block by block.

Autocompletion#

Commands autocomplete with the tab key.
Here are some examples:

  • sh <tab> becomes show
  • int becomes interface

You can start typing the command and press TAB as soon as possible. There may be ambiguity. You need to continue typing to specify the command to the system. So it can complete it correctly.

Filtering results#

🫱 Adding | after a command allows you to filter its result:

interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface Vlan1

Here include filters the result to include the word interface.

Abbreviated commands#

The Cisco CLI supports command abbreviations.
Here are some examples:

AbbreviationFull command
conf tconfigure terminal
sh ip int bshow interface brief
wrWrite memory
int g0/0interface GigabitEthernet0/0

Error reporting#

The environment indicates where there is an error.
Incorrect syntax or wrong mode (do “command”).

Router#sh ip routte
^
% Invalid input detected at '^' marker.

Keyboard shortcuts#

SequenceDescription
CTRL + ABeginning of line
CTRL + EEnd of line
CTRL + P or Previous command
CTRL + N or Next command
CTRL + F or Cursor right
CTRL + B or Cursor left
CTRL + ZReturn to privileged mode
CTRL + CInterrupt
CTRL + SHIFT + 6 / CTRL + SHIFT + ^Forced interruption
TABComplete a command
BackspaceErase a character to the left
CTRL + RRedisplay the line
CTRL + UErase the line
CTRL + WErase a word
ESC + bMove back a word
ESC + fMove forward a word

Some tips#

The do command allows you to execute a privileged mode command in another mode.

Switch(config)#show run
^
% Invalid input detected at '^' marker.
Switch(config)#do show run
Building configuration...

Disabling DNS lookups#

With DNS resolution (enabled by default), a mistyped command can be interpreted, in privileged mode, as an attempt to connect to a remote domain and block the console for some time:

Switch#showe
Translating "showe"...domain server (255.255.255.255)

To disable DNS resolution:

no ip domain-lookup

Disabling announcements#

Each time you change the state of an interface (up, down, etc…)
The device writes a message in the CLI, indicating what has changed. This can be annoying when typing commands. It is possible to disable these announcements:

%LINK-1-CHANGED: Interface FastEthernet0/1, changed state to up
no logging console

Renaming a device#

hostname MY_SWITCH

Setting an enable password#

To enter the “enable” mode of the device, it is possible and even recommended to set a password.

Switch(config)#enable secret MY_PASSWORD

With the secret option, the password is hashed.

Viewing the general configuration#

To display information about the global configuration (hostname, services, interfaces, spanning-tree, password, etc.), execute this command:

Switch#show running-config
Building configuration...
Current configuration : 1080 bytes
!
version 15.0
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
!
interface FastEthernet0/2
--More--

Viewing VLAN configuration#

To display information about VLAN configuration:

Switch#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig0/1, Gig0/2
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
--More--
NOTE

VLANs 1002, 1003, 1004, 1005 are reserved in the system for token ring. This system being obsolete, these VLANs are not used.

Here interfaces F0/1-24 and G0/1-2 belong to VLAN 1.

Removing/disabling an element#

The no suffix allows you to remove/disable/delete any previously written command or configuration.

no ip address 192.168.1.1 255.255.255.0

Removes the IP address assigned to the interface.

Router(config)#no router ospf

Disables the OSPF protocol (and its configuration) from the router.

Help, autocompletion, monitoring, shortcuts
https://xsec.fr/posts/networking/cisco-misc/
Author
Xsec
Published at
2021-09-14
License
CC BY-NC-SA 4.0