Cisco IOS
Cisco IOS (Internetwork Operating System) is the proprietary operating system running on most Cisco routers and switches. It provides a command-line interface (CLI) for configuration, monitoring, and troubleshooting.
System information
show version # Software & hardware information
show running-config # Current configuration
show startup-config # Boot configuration
show history # Command history buffer
show ip interface brief # Interface overview
show interface $TYPE $NUM # Detailed interface information
show interfaces description # Interface descriptions
show interfaces status # Status of all interfaces
show crypto key mypubkey rsa # Current SSH public key
show dhcp lease # Current DHCP status/informationConfiguration modes
config # General configuration mode
config interface # Interface configuration mode
config line # Serial console configuration modeGeneral configuration commands
hostname $HOSTNAME # Set switch hostname
enable secret $MD5_PASS # Set password using MD5 hash
enable password $PASSWORD # Set password using clear text
banner motd $BANNER # Set login banner (use "$" like "EOF")
ip default-gateway $IP_ADDRESS # Set default gateway
copy running-config startup-config # Persist current configNetwork interface configuration
interface $IFACE_TYPE $IFACE_NUM
ip address $IP_ADDRESS $NETMASKLogin (“line”) configuration
Set console port:
line con 0
password $PASSWORD
loginSet terminal (VTY) connections:
line vty 0 $VTY_NUM
password $PASSWORD
loginSSH configuration mode
To enter configuration mode over ssh, use config t. To exit, use exit. To save to flash, use write.
In configuration mode, prefix any normal command with do to execute it without leaving config mode:
# Normal mode
show run
# Config mode
do show runSources
Related: cisco-switch-setup, tcp, wireshark