\section{ip}
\begin{frame}
   {ip}

   \begin{itemize}
      \item Used to configure, control, and query interface
      parameters and manipulate:
      \begin{itemize}
         \item Devices
         \item Routing
         \item Tunnels
      \end{itemize}
      \item Basic syntax:
      \begin{cmd}
ip [ OPTIONS ] OBJECT { COMMAND | help }
ip [ -force ] -batch filename
      \end{cmd}
      where the second form can read commands from a
      designated file.
      \item Works with \textbf{netlink} sockets, not \textbf{ioctl} system
      calls
      \item Newer and more versatile than \texttt{ifconfig}
   \end{itemize}

\end{frame}

\cprotect\note{

   \textbf{ip} is the preferred command line
   utility as compared to the venerable \textbf{ifconfig} we discuss next.  It is
   more versatile as well as more efficient because it uses
   \textbf{netlink} sockets rather than \textbf{ioctl} system
   calls.

   \textbf{ip} can be used for a wide variety of tasks.  It can
   be used to display and control devices, routing, policy-based routing,
   and tunneling.

   The basic syntax is:
   \begin{cmd}
ip [ OPTIONS ] OBJECT { COMMAND | help }
ip [ -force ] -batch filename
   \end{cmd}
   where the second form can read commands from a designated file.

   \textbf{ip} is a multiplex utility; the \texttt{OBJECT}
   argument describes what kind of action is going to be
   performed. The possible \texttt{COMMANDS} depend on
   which \textbf{OBJECT} is selected.  Here are some of
   the main values of \texttt{OBJECT}:

   \begin{table}[H]
      \caption{ip}
      \vspace{-15pt}
   \end{table}

   \small{\begin{tcolorbox}[tabularx={p{0.25\textwidth}|X}]

         \texttt{OBJECT}
         &
         \textbf{Function}
         \\ \hline
         \hline
         \texttt{address}  & \textbf{IPv4} or \textbf{IPv6} protocol device address
         \\ \hline
         \texttt{link}     & Network Devices
         \\ \hline
         \texttt{maddress} & Multicast Address
         \\ \hline
         \texttt{monitor}  & Watch for netlink messages
         \\ \hline
         \texttt{route}    & Routing table entry
         \\ \hline
         \texttt{rule}     & Rule in the routing policy database
         \\ \hline
         \texttt{tunnel}   & Tunnel over IP
      \end{tcolorbox}}

}
\begin{frame}
   {Using ip: Examples}
   \begin{itemize}

      \item
      Show information for all interfaces:
      \begin{cmd}
$ ip link show
      \end{cmd}
      \item
      Show information for \texttt{eth0} interface, including statistics:
      \begin{cmd}
$ ip -s link show eth0
      \end{cmd}
      \item
      Set ip address for \texttt{eth0}:
      \begin{cmd}
$ sudo ip addr add 192.168.1.7 dev eth0
      \end{cmd}
      \item
      Bring interface \texttt{eth0} down:
      \begin{cmd}
$ sudo ip link set eth0 down
      \end{cmd}
      \item
      Set MTU to 1480 for interface \texttt{eth0}
      \begin{cmd}
$ sudo ip link set eth0 mtu 1480
      \end{cmd}
      \item
      Set route to network:
      \begin{cmd}
$ sudo ip route add 172.16.1.0/24 via 192.168.1.5
      \end{cmd}
   \end{itemize}

\end{frame}

\cprotect\note{

   \begin{figure}[H]
      \includegraphics[width=7in]{IMAGES/ipubuntu}
      \caption{Using ip}
   \end{figure}


}
\section{ifconfig}
\begin{frame}
   {ifconfig}

   \begin{itemize}
      \item Used to configure, control, and query interface
      parameters
      \item Being superseded by \textbf{ip}:
      \begin{itemize}
         \item
         Some newer \textbf{Linux} distributions do not
         install by default
      \end{itemize}
      \item Used from the command line
      \begin{cmd}
$ ifconfig
$ ifconfig eth0
$ ifconfig eth0 192.168.1.50
$ ifconfig eth0 netmask 255.255.255.0
$ ifconfig eth0 down
$ ifconfig eth0 mtu 1480
      \end{cmd}
      \item Also called by network startup scripts
   \end{itemize}

\end{frame}

\cprotect\note{
   \begin{figure}[H]
      \includegraphics[width=6.25in]{IMAGES/ifconfigrhel7}
      \caption{ifconfig Output}
   \end{figure}

}
\begin{frame}
   {ifconfig Examples}

   \begin{itemize}
      \item
      Display information about all interfaces, or just one:
      \begin{cmd}
$ ifconfig
$ ifconfig eth0
      \end{cmd}
      \item
      Set the IP address to 192.168.1.50 on interface \texttt{eth0}:
      \begin{cmd}
$ sudo ifconfig eth0 192.168.1.50
      \end{cmd}
      \item
      Set the netmask to 24-bit:
      \begin{cmd}
$ sudo ifconfig eth0 netmask 255.255.255.0
      \end{cmd}
      \item
      Bring interface \texttt{eth0} up or down:
      \begin{cmd}
$ sudo ifconfig eth0 up
$ sudo ifconfig eth0 down
      \end{cmd}
      \item
      Set the \textbf{MTU} (\textbf{M}aximum \textbf{T}ransfer
      \textbf{U}nit) to 1480 bytes for interface \texttt{eth0}:
      \begin{cmd}
$ sudo ifconfig eth0 mtu 1480
      \end{cmd}

   \end{itemize}

\end{frame}

\cprotect\note{

   \textbf{ifconfig} is a system administration utility
   long found in \textbf{UNIX}-like operating systems to
   configure, control, and query network interface
   parameters from either the command line or from system
   configuration scripts.

   It is also often called by
   network startup scripts.

   The above slide provides some usage examples.


}
