\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{JKJK36} \pdfinfo{ /Title (basic-cisco-ios-cli-commands.pdf) /Creator (Cheatography) /Author (JKJK36) /Subject (Basic Cisco IOS CLI Commands Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Basic Cisco IOS CLI Commands Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{JKJK36} via \textcolor{DarkBackground}{\uline{cheatography.com/147654/cs/32114/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}JKJK36 \\ \uline{cheatography.com/jkjk36} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 17th May, 2022.\\ Updated 17th May, 2022.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{p{0.4177 cm} p{0.75186 cm} x{1.29487 cm} x{1.71257 cm} } \SetRowColor{DarkBackground} \mymulticolumn{4}{x{5.377cm}}{\bf\textcolor{white}{User Levels/Modes}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Level}} & {\bf{Mode}} & {\bf{User View}} & {\bf{Some Available Commands}} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} {\bf{1}} & User EXEC & Switch{\bf{\textgreater{}}} & {\bf{enable}}\{\{nl\}\}{\bf{ping}}\{\{nl\}\}{\bf{show (basic only)}} \tn % Row Count 7 (+ 4) % Row 2 \SetRowColor{LightBackground} {\bf{2}} & \seqsplit{Privileged} EXEC & Switch{\bf{\#}} & {\bf{config}}\{\{nl\}\}{\bf{User EXEC commands}}\{\{nl\}\} \tn % Row Count 10 (+ 3) % Row 3 \SetRowColor{white} {\bf{3}} & Global \seqsplit{Config.} & Switch{\bf{(config)\#}} & {\bf{hostname}}\{\{nl\}\}{\bf{enable secret}}\{\{nl\}\}{\bf{interface/router/line}} \tn % Row Count 15 (+ 5) % Row 4 \SetRowColor{LightBackground} {\bf{4a}} & \seqsplit{Interface} \seqsplit{Config.} & Switch{\bf{(config-if)\#}} & {\bf{shut/no shut}}\{\{nl\}\}{\bf{switchport mode}}\{\{nl\}\}{\bf{switchport access vlan}} \tn % Row Count 20 (+ 5) % Row 5 \SetRowColor{white} {\bf{4b}} & Router \seqsplit{Config.} & Switch{\bf{(config-router)\#}} & {\bf{version}}\{\{nl\}\}{\bf{network}} \tn % Row Count 23 (+ 3) % Row 6 \SetRowColor{LightBackground} {\bf{4c}} & Line \seqsplit{Config.} & Switch{\bf{(config-line)\#}} & {\bf{login}}\{\{nl\}\}{\bf{password}} \tn % Row Count 26 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}----} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.60195 cm} x{1.32733 cm} x{1.64772 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Changing User Mode}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Command}} & {\bf{Abbreviated Command}} & {\bf{Change in Mode}} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} {\bf{\textgreater{}enable}} & {\bf{\textgreater{}en}} & Moves from User Exec to Privileged EXEC\{\{nl\}\}User is prompted for a password \tn % Row Count 9 (+ 6) % Row 2 \SetRowColor{LightBackground} {\bf{\#config terminal}} & {\bf{\#config t}} & Moves from Privileged EXEC to Global Config \tn % Row Count 13 (+ 4) % Row 3 \SetRowColor{white} {\bf{(config)\# interface {[}{\emph{type/number}}{]}}} & {\bf{(config)\# int {[}{\emph{type/number}}{]}}} & Moves to Interface Config \tn % Row Count 16 (+ 3) % Row 4 \SetRowColor{LightBackground} {\bf{(config)\# vlan {\emph{{[}\#{]}}}}} & {\bf{(config)\# vl {\emph{{[}\#{]}}}}} & Moves to VLAN Config \tn % Row Count 18 (+ 2) % Row 5 \SetRowColor{white} {\bf{exit}} & & Exits current mode and moves back to previous mode \tn % Row Count 22 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{5.377cm}}{Remember to enter the appropriate mode while configuring/working. Some commands will only work in specific modes.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.53827 cm} x{2.43873 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Getting Started - Global Configuration}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Command}} & {\bf{Purpose}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{hostname {\emph{name}}}} & Configure hostname on device \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{int vlan {[}{\emph{\#}}{]} \{\{nl\}\}ip address{[}{\emph{address}}{]}{[}{\emph{subnet mask}}{]}}} & Configure IP address on management VLAN \tn % Row Count 7 (+ 4) % Row 3 \SetRowColor{white} {\bf{vlan {[}{\emph{\#}}{]}\{\{nl\}\}name {\emph{{[}name/ip address{]}}}}} & Configures vlan with specified name \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} {\bf{ip default-gateway {\emph{address}}}} & Configure default gateway \tn % Row Count 12 (+ 2) % Row 5 \SetRowColor{white} {\bf{banner motd \#{\emph{insert message}}\#}} & Configure banner message of the day \tn % Row Count 14 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{enable secret {\emph{{[}secret{]}}}}} & Enables specified secret on device \tn % Row Count 16 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Some of the commands used during the base config. Others are in the Google Doc.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Important Show (sh) Commands}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Command}} & {\bf{What it Shows}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{sh boot}} & Boot path-list \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{sh cdp neighbors}} & Cisco Discovery Protocol neighbors \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} {\bf{sh int {[}{\emph{type/number}}{]}}} & Network statistics of specified interface (status, input errors, etc.) \tn % Row Count 8 (+ 4) % Row 4 \SetRowColor{LightBackground} {\bf{sh int status}} & \seqsplit{Names/statuses/VLANs/etc}. of all interfaces \tn % Row Count 11 (+ 3) % Row 5 \SetRowColor{white} {\bf{sh run int {[}{\emph{type/number}}{]}}} & Running config on specified interface (switchport mode, switchport access vlan, etc.) \tn % Row Count 16 (+ 5) % Row 6 \SetRowColor{LightBackground} {\bf{sh running-config (sh run)}} & Current switch configuration \tn % Row Count 18 (+ 2) % Row 7 \SetRowColor{white} {\bf{sh history}} & Switch session command history \tn % Row Count 20 (+ 2) % Row 8 \SetRowColor{LightBackground} {\bf{sh lldp neighbors}} & Link Layer Discovery Protocol neighbors \tn % Row Count 22 (+ 2) % Row 9 \SetRowColor{white} {\bf{sh logging}} & Switch log (changes in int statuses) \tn % Row Count 24 (+ 2) % Row 10 \SetRowColor{LightBackground} {\bf{sh power-inline}} & Switch inline power \seqsplit{(Available/Used/Remaining)} \tn % Row Count 27 (+ 3) % Row 11 \SetRowColor{white} {\bf{sh spanning-tree}}\{\{nl\}\}{\bf{sh spanning-tree vlan {\emph{\#}}}} & Spanning tree topology (Desg/Root)\{\{nl\}\}2nd command: STP of specific vlan \tn % Row Count 31 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Important Show (sh) Commands (cont)}} \tn % Row 12 \SetRowColor{LightBackground} {\bf{sh switch}} & Switch stack information \tn % Row Count 2 (+ 2) % Row 13 \SetRowColor{white} {\bf{sh version}} & Hardware and software statuses \tn % Row Count 4 (+ 2) % Row 14 \SetRowColor{LightBackground} {\bf{sh vlan}} & \seqsplit{VLANs/names/statuses/ports} \tn % Row Count 6 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Interface Types and Configuration}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Components}} & {\bf{Application/Purpose}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{Type(s)}}\{\{nl\}\}FastEthernet (fa)\{\{nl\}\}GigabitEthernet (gi)\{\{nl\}\}FiveGigabitEthernet (fi)\{\{nl\}\}TenGigabitEthernet (te) & {\bf{Type changes with sw model}}:\{\{nl\}\}3550/60 - fa\{\{nl\}\}3750, 2960, 9200, 930024UN - gi\{\{nl\}\}930048UN - fi \tn % Row Count 8 (+ 6) % Row 2 \SetRowColor{LightBackground} {\bf{Stack Member Number}}\{\{nl\}\}1-8 (Ex: {\bf{1}}/0/1) & {\bf{Identifies int. switch stack position}} \tn % Row Count 11 (+ 3) % Row 3 \SetRowColor{white} {\bf{Module Number}}\{\{nl\}\}0-1 (Ex: 1/{\bf{1}}/1) & {\bf{Identifies module number}}\{\{nl\}\}0 = switch port\{\{nl\}\}1 = uplink port \tn % Row Count 15 (+ 4) % Row 4 \SetRowColor{LightBackground} {\bf{Port Number}}\{\{nl\}\}Ex: 1/0/{\bf{1}} - 1/0/{\bf{48}}\{\{nl\}\}1/1/{\bf{1}} - 1/1/{\bf{4}} & {\bf{Identifies int. number on switch}}\{\{nl\}\}1-48 = switch ports\{\{nl\}\}1-4 = uplink ports \tn % Row Count 20 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Config Commands for Interfaces}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Command}} & {\bf{Purpose}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{switchport access vlan {\emph{\#}}}} & Assigns interface to the specified VLAN \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{switchport mode {[}{\emph{mode}}{]}}}\{\{nl\}\}Access\{\{nl\}\}Trunk & Changes an interface's mode\{\{nl\}\} \tn % Row Count 6 (+ 3) % Row 3 \SetRowColor{white} {\bf{switchport voice vlan {\emph{\#}}}} & Assigns interface to the specified voice VLAN \tn % Row Count 9 (+ 3) % Row 4 \SetRowColor{LightBackground} {\bf{ip dhcp snooping trust}} & Enables the DHCP snooping security feature. {\bf{Needed on trunk ports.}}* \tn % Row Count 13 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{*ip dhcp snooping trust}} will make the port trusted and DHCP server messages/traffic can flow through that interface. Messages will be dropped otherwise.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.34379 cm} x{3.63321 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Helpful Shortcuts on the Keyboard}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Shortcut}} & {\bf{Purpose}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{Ctrl-Z}} & Goes back to Privileged EXEC Mode (Switch\#) \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{Tab}} & Autofills the rest of the command \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} {\bf{Up Arrow}} & Types the last command entered \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{Right Click}} & Pastes what is currently copied in the clipboard \tn % Row Count 10 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Commands for when you don't want to type everything in Cisco CLI.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.84149 cm} x{3.13551 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Commands for Wiping a Switch}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Command}} & {\bf{Purpose}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{delete vlan.dat}} & Deletes VLAN Database from switch \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{write erase}} & Erases configuration files \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} {\bf{reload}} & Prompts the switch to reboot \tn % Row Count 7 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{These commands can be performed in Privileged EXEC Mode. After executing the reload command, do not save the system configuration, as seen below: \newline {\bf{System configuration has been modified. Save? {[}yes/no{]}: n}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}