\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{logiweb} \pdfinfo{ /Title (fortigate-troubleshooting.pdf) /Creator (Cheatography) /Author (logiweb) /Subject (Fortigate troubleshooting 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}{DA2C28} \definecolor{LightBackground}{HTML}{FCF1F1} \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{Fortigate troubleshooting Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{logiweb} via \textcolor{DarkBackground}{\uline{cheatography.com/63715/cs/16164/}}} \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}logiweb \\ \uline{cheatography.com/logiweb} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 22nd June, 2018.\\ 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{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{CLI Basics}} \tn % Row 0 \SetRowColor{LightBackground} show s full-configuration & show configuration \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} config vdom & enter the correct vdom or global configuration \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} edit {\bf{\textless{}vdom-name\textgreater{}}} & select vdom \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} show | grep -f ipv6 & To find a CLI command within the configuration, you can use the pipe sign "|" \tn % Row Count 12 (+ 5) % Row 4 \SetRowColor{LightBackground} execute backup config flash & save your config \tn % Row Count 14 (+ 2) % Row 5 \SetRowColor{white} config system global \{\{nl\}\} ~ ~ set \seqsplit{revision-backup-on-logout} enable \{\{nl\}\} end & aves a backup of your configuration after each logout automatically \tn % Row Count 19 (+ 5) % Row 6 \SetRowColor{LightBackground} get system interface physical & overview of hardware interfaces \tn % Row Count 21 (+ 2) % Row 7 \SetRowColor{white} get hardware nic \textless{}nic-name\textgreater{} & Details of a single network interface, same as: diagnose hardware deviceinfo nic \textless{}nic-name\textgreater{} \tn % Row Count 26 (+ 5) % Row 8 \SetRowColor{LightBackground} fnsysctl ifconfig & kind of hidden command to see more interface stats such as errors \tn % Row Count 30 (+ 4) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{CLI Basics (cont)}} \tn % Row 9 \SetRowColor{LightBackground} get system status & ==show version \tn % Row Count 1 (+ 1) % Row 10 \SetRowColor{white} get system performance status & CPU and network usage \tn % Row Count 3 (+ 2) % Row 11 \SetRowColor{LightBackground} diagnose sys top & top with all forked processed \tn % Row Count 5 (+ 2) % Row 12 \SetRowColor{white} diagnose sys top-summary & top easier, incl. CPU and mem bars. \tn % Row Count 7 (+ 2) % Row 13 \SetRowColor{LightBackground} diagnose test application dnsproxy 6 & shows the IP addresses of FQDN objects \tn % Row Count 9 (+ 2) % Row 14 \SetRowColor{white} diagnose debug crashlog read & shows crashlog, a status of 0 indicates a normal close of a process! \tn % Row Count 13 (+ 4) % Row 15 \SetRowColor{LightBackground} execute reboot & reboot your device \tn % Row Count 14 (+ 1) % Row 16 \SetRowColor{white} config system interface \{\{nl\}\} edit mgmt \{\{nl\}\} set ip {\bf{192.168.1.1 255.255.255.0}} \{\{nl\}\} set allowaccess ping https ssh \{\{nl\}\} next \{\{nl\}\} end & To change the IP address of the mgmt interface \tn % Row Count 22 (+ 8) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{9.6712 cm} x{7.5988 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{General Network Troubleshooting}} \tn % Row 0 \SetRowColor{LightBackground} execute ping-options ? \{\{nl\}\} execute ping-options source \textless{}source-interface-IP\textgreater{} \{\{nl\}\} execute ping \textless{}hostname|ip\textgreater{} & Ping from another source address \tn % Row Count 6 (+ 6) % Row 1 \SetRowColor{white} execute traceroute \textless{}hostname|ip\textgreater{} \{\{nl\}\} execute traceroute-options ? & traceroute \tn % Row Count 10 (+ 4) % Row 2 \SetRowColor{LightBackground} execute ping-options view-settings & view settings \tn % Row Count 12 (+ 2) % Row 3 \SetRowColor{white} execute ping6-options view-settings & view settings \tn % Row Count 14 (+ 2) % Row 4 \SetRowColor{LightBackground} execute traceroute-options view-settings & view settings \tn % Row Count 16 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{17.67cm}}{\bf\textcolor{white}{Remote Server Authentication Test}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{diagnose test authserver ldap \textless{}server\_name\textgreater{} \textless{}username\textgreater{} \textless{}password\textgreater{}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{diagnose test authserver radius \textless{}server\_name\textgreater{} \textless{}chap | pap | mschap | mschap2\textgreater{} \textless{}username\textgreater{} \textless{}password\textgreater{} diagnose test authserver local \textless{}group\_name\textgreater{} \textless{}username\textgreater{} \textless{}password\textgreater{}} \tn % Row Count 6 (+ 4) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{diagnose test authserver local \textless{}group\_name\textgreater{} \textless{}username\textgreater{} \textless{}password\textgreater{}} \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Session Table}} \tn % Row 0 \SetRowColor{LightBackground} get system session list & rough view with NAT, only IPv4 \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} diagnose sys session filter clear \{\{nl\}\} diagnose sys session filter ? \{\{nl\}\} diagnose sys session filter dst 8.8.8.8 \{\{nl\}\} diagnose sys session filter dport 53 \{\{nl\}\} diagnose sys session list & show the session table with the filter just set \tn % Row Count 12 (+ 10) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Routing}} \tn % Row 0 \SetRowColor{LightBackground} get router info routing-table all & IPv4 needs an "all" at the end \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} get router info6 kernel & Forwarding Information Base \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} diagnose firewall proute6 list & \#Policy Routes + WAN Load Balancing \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} 2 3 4 diagnose sys ha status \{\{nl\}\} execute ha manage ? \{\{nl\}\} execute ha manage {\bf{\textless{}device-index\textgreater{}}} \{\{nl\}\} diagnose sys ha showcsum & verify the checksum of all synchronized peers \tn % Row Count 13 (+ 7) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{17.67cm}}{\bf\textcolor{white}{Flow}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{display the next 10 packets, after that, disable the flow: diagnose debug disable} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{diagnose debug reset \{\{nl\}\} diagnose debug flow filter ? \{\{nl\}\} diagnose debug flow filter saddr 172.16.27.148 \{\{nl\}\} diagnose debug flow filter daddr 8.8.8.8 \{\{nl\}\} diagnose debug flow show console enable \{\{nl\}\} diagnose debug enable \{\{nl\}\} diagnose debug flow trace start \{\{nl\}\} diagnose debug disable} \tn % Row Count 9 (+ 7) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{17.67cm}}{\bf\textcolor{white}{VPN}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{To show details about IKE/IPsec connections, use these commands:} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{get vpn ike gateway \textless{}name\textgreater{} \{\{nl\}\} get vpn ipsec tunnel name \textless{}name\textgreater{} \{\{nl\}\} get vpn ipsec tunnel details \{\{nl\}\} diagnose vpn tunnel list \{\{nl\}\} diagnose vpn ipsec status \#shows all crypto devices with counters that are used by the VPN \{\{nl\}\} get router info routing-table all} \tn % Row Count 8 (+ 6) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{To debug IKE/IPsec sessions, use the VPN debug:} \tn % Row Count 9 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{diagnose debug reset \{\{nl\}\} diagnose vpn ike log-filter clear \{\{nl\}\} diagnose vpn ike log-filter ? \{\{nl\}\} diagnose vpn ike log-filter dst-addr4 1.2.3.4 \{\{nl\}\} diagnose debug app ike 255 {\emph{ \#shows phase 1 and phase 2 output}} \{\{nl\}\} diagnose debug {\bf{ enable}} {\emph{ \#after enough output, disable the debug:}} \{\{nl\}\} diagnose debug {\bf{ disable}}} \tn % Row Count 17 (+ 8) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{To reset a certain VPN connection} \tn % Row Count 18 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{diag vpn tunnel reset {\bf{\textless{}phase1 name\textgreater{}}}} \tn % Row Count 19 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{17.67cm}}{\bf\textcolor{white}{Defaults}} \tn \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{Just a reminder for myself: \newline % Row Count 1 (+ 1) IP: 192.168.1.99 \newline % Row Count 2 (+ 1) Login: admin \newline % Row Count 3 (+ 1) Password: \textless{}blank\textgreater{}% Row Count 4 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{9.6712 cm} x{7.5988 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Backup and Restore}} \tn % Row 0 \SetRowColor{LightBackground} execute backup full-config tftp \textless{}full-config-filename\textgreater{} \textless{}tftp server ip\textgreater{} & Backup command with tftp server \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} execute restore config tftp \textless{}full-config-filename\textgreater{} \textless{}tftp server ip\textgreater{} & Restore command with tftp server \tn % Row Count 8 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \end{document}