\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{kanisthaw} \pdfinfo{ /Title (cisco-command-1-by-kanisthaw.pdf) /Creator (Cheatography) /Author (kanisthaw) /Subject (Cisco Command\#1 BY kanisthaw 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}{E66A6A} \definecolor{LightBackground}{HTML}{FDF5F5} \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{Cisco Command\#1 BY kanisthaw Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{kanisthaw} via \textcolor{DarkBackground}{\uline{cheatography.com/28442/cs/8364/}}} \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}kanisthaw \\ \uline{cheatography.com/kanisthaw} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 7th June, 2016.\\ Updated 7th June, 2016.\\ 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.4577 cm} p{0.4577 cm} p{0.4577 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Router Modes}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{3}{x{5.377cm}}{{\bf{Router\textgreater{}:}} User mode = Limited to basic monitoring commands} \tn % Row 1 \SetRowColor{white} \mymulticolumn{3}{x{5.377cm}}{{\bf{Router\#:}} Privileged mode (exec-level mode) = Provides access to all other router commands} \tn % Row 2 \SetRowColor{LightBackground} \mymulticolumn{3}{x{5.377cm}}{{\bf{Router(config)\#:}} global configuration mode = Commands that affect the entire system} \tn % Row 3 \SetRowColor{white} \mymulticolumn{3}{x{5.377cm}}{{\bf{Router(config-subif)\#:}} subinterface mode = Commands that affect subinterfaces} \tn % Row 4 \SetRowColor{LightBackground} \mymulticolumn{3}{x{5.377cm}}{{\bf{Router(config-line)\#:}} line mode = Commands that affect in lines modes (console, vty, aux…)} \tn % Row 5 \SetRowColor{white} \mymulticolumn{3}{x{5.377cm}}{{\bf{Router(config-router)\#:}} router configuration mode} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Changing switch hostname}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Switch(config)\# {\bf{hostname}} SW1% Row Count 1 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Configuring passwords}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{SW1(config)\# {\bf{enable secret}} nutty !MD5 hash \newline % Row Count 1 (+ 1) SW1(config)\# {\bf{enable password}} 1234% Row Count 2 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Encrypting passwords}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{SW1(config)\# {\bf{service password-encryption}}} \tn % Row Count 1 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Working environment}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{SW1(config)\# no ip domain-lookup \newline % Row Count 1 (+ 1) SW1(config)\# line vty 0 4 \newline % Row Count 2 (+ 1) SW1(config-line)\# history size 15 \newline % Row Count 3 (+ 1) SW1(config-line)\# exec-timeout 10 30 \newline % Row Count 4 (+ 1) SW1(config-line)\# logging synchronous% Row Count 5 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Saving configuration}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{SW1\# {\bf{copy running-config}} nutty \newline % Row Count 1 (+ 1) ! Destination filename {[}nutty{]} \newline % Row Count 2 (+ 1) SW1\# {\bf{wr}}% Row Count 3 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Description, speed and duplex}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{SW1(config)\# interface fastEthernet 0/1 \newline % Row Count 1 (+ 1) SW1(config-if)\# description LINK TO INTERNET ROUTER \newline % Row Count 3 (+ 2) SW1(config-if)\# speed 100 ! Options: 10, 100, auto \newline % Row Count 5 (+ 2) ! The range keyword used to set a group of interfaces at once. \newline % Row Count 7 (+ 2) SW1(config)\# interface range fastEthernet 0/5 – 10 \newline % Row Count 9 (+ 2) SW1(config-if-range)\# duplex full (options: half, full, auto)% Row Count 11 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Setting the default gateway}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{SW1(config)\# {\bf{ip default-gateway}} 172.16.1.1% Row Count 1 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Securing console port}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{SW1(config)\# {\bf{line}} con 0 \newline % Row Count 1 (+ 1) SW1(config-line)\# {\bf{password}} cisco \newline % Row Count 2 (+ 1) SW1(config-line)\# {\bf{login}}% Row Count 3 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Aliases}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{! Used to create shortcuts for long commands.} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{SW1(config)\# {\bf{alias exec}} c configure terminal} \tn % Row Count 2 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Securing terminal lines}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{SW1(config)\# {\bf{line vty}} 0 4 \newline % Row Count 1 (+ 1) SW1(config-line)\# {\bf{password}} cisco \newline % Row Count 2 (+ 1) SW1(config-line)\# {\bf{login}}% Row Count 3 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Configuring banners}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{SW1(config)\# {\bf{banner motd}} \$% Row Count 1 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Giving the switch an IP address}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{SW1(config)\# {\bf{interface vlan 1}} \newline % Row Count 1 (+ 1) SW1(config-if)\# {\bf{ip address}} 172.16.1.11 255.255.255.0 ! or DHCP \newline % Row Count 3 (+ 2) SW1(config-if)\# {\bf{no shutdown}}% Row Count 4 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Configuring switch to use SSH}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{\{\{fa-caret-right\}\}Configure DNS domain name :}} \newline % Row Count 1 (+ 1) SW1(config)\# {\bf{ip domain-name}} example.com \newline % Row Count 2 (+ 1) {\bf{\{\{fa-caret-right\}\}Configure a username and password :}} \newline % Row Count 4 (+ 2) SW1(config)\# {\bf{username}} admin {\bf{password}} cisco \newline % Row Count 6 (+ 2) {\bf{\{\{fa-caret-right\}\}Generate encryption keys :}} \newline % Row Count 7 (+ 1) ! The size of the key modulus in the range of 360 to 2048 \newline % Row Count 9 (+ 2) SW1(config)\# {\bf{crypto key generate rsa}} \newline % Row Count 10 (+ 1) How many bits in the modulus {[}512{]}: 1024 \newline % Row Count 11 (+ 1) {\bf{\{\{fa-caret-right\}\}Define SSH version to use :}} \newline % Row Count 12 (+ 1) SW1(config)\#{\bf{ ip ssh version 2}} \newline % Row Count 13 (+ 1) {\bf{\{\{fa-caret-right\}\}Enable vty lines to use SSH :}} \newline % Row Count 15 (+ 2) SW1(config)\# line vty 0 4 \newline % Row Count 16 (+ 1) SW1(config-line)\# login local \newline % Row Count 17 (+ 1) ! You can set vty lines to use only telnet or only ssh or both as in the example. \newline % Row Count 19 (+ 2) SW1(config-line)\# transport input telnet ssh% Row Count 20 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Verify Basic Configuration}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\{\{fa-caret-right\}\}Shows information about the switch and its interfaces, RAM, NVRAM, flash, IOS, etc \newline % Row Count 3 (+ 3) SW1\# {\bf{show version}} \newline % Row Count 4 (+ 1) \{\{fa-caret-right\}\}Shows the current configuration file stored in DRAM. \newline % Row Count 6 (+ 2) SW1\# {\bf{show running-config}} \newline % Row Count 7 (+ 1) \{\{fa-caret-right\}\}Shows the configuration file stored in NVRAM which is used at first boot process. \newline % Row Count 9 (+ 2) SW1\# {\bf{show startup-config}} \newline % Row Count 10 (+ 1) \{\{fa-caret-right\}\}Lists the commands currently held in the history buffer. \newline % Row Count 12 (+ 2) SW1\# {\bf{show history}} \newline % Row Count 13 (+ 1) \{\{fa-caret-right\}\}Shows an overview of all interfaces, their physical status, protocol status and ip address if assigned. \newline % Row Count 16 (+ 3) SW1\# {\bf{show ip interface brief}} \newline % Row Count 17 (+ 1) \{\{fa-caret-right\}\}Shows detailed information about the specified interface, its status, protocol, duplex, speed, encapsulation, last 5 min traffic. \newline % Row Count 20 (+ 3) SW1\# {\bf{show interface vlan 1}} \newline % Row Count 21 (+ 1) \{\{fa-caret-right\}\}Shows the description of all interfaces \newline % Row Count 23 (+ 2) SW1\# {\bf{show interfaces description}} \newline % Row Count 24 (+ 1) \{\{fa-caret-right\}\}Shows the status of all interfaces like connected or not, speed, duplex, trunk or access vlan. \newline % Row Count 27 (+ 3) SW1\# {\bf{show interfaces status}} \newline % Row Count 28 (+ 1) \{\{fa-caret-right\}\}Shows the public encryption key used for SSH. \newline % Row Count 30 (+ 2) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Verify Basic Configuration (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{SW1\# {\bf{show crypto key mypubkey rsa}} \newline % Row Count 1 (+ 1) \{\{fa-caret-right\}\}Shows information about the leased IP address (when an interface is configured to get IP address via a dhcp server) \newline % Row Count 4 (+ 3) SW1\# {\bf{show dhcp lease}}% Row Count 5 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}