diff options
| author | Jan Altenberg <jan@linutronix.de> | 2011-01-24 16:49:13 +0100 |
|---|---|---|
| committer | Jan Altenberg <jan@linutronix.de> | 2011-01-24 16:49:13 +0100 |
| commit | 115bace1e4e376c602ac27c9eff699ef68e9be90 (patch) | |
| tree | cbf8e6d40ce2eebc2e808aa98ace9c11f342daa5 /linux-basics | |
| parent | c946fbbf09fcd7dd6f49537bef5e6cf4dc530a8c (diff) | |
Started networking chapter.
Currently just some random networking commands.
Diffstat (limited to 'linux-basics')
| -rw-r--r-- | linux-basics/networking/Makefile | 9 | ||||
| -rw-r--r-- | linux-basics/networking/pres_networking_en.tex | 151 |
2 files changed, 160 insertions, 0 deletions
diff --git a/linux-basics/networking/Makefile b/linux-basics/networking/Makefile new file mode 100644 index 0000000..4663d52 --- /dev/null +++ b/linux-basics/networking/Makefile @@ -0,0 +1,9 @@ +all: + for pdf in `ls -1 *.tex` ; do \ + pdflatex $$pdf; \ + pdflatex $$pdf; \ + done + +clean: + rm -f *.aux *.log *.pdf *.log *.snm *.toc *.vrb *.nav *.out + diff --git a/linux-basics/networking/pres_networking_en.tex b/linux-basics/networking/pres_networking_en.tex new file mode 100644 index 0000000..2adfc3c --- /dev/null +++ b/linux-basics/networking/pres_networking_en.tex @@ -0,0 +1,151 @@ +\documentclass[11pt]{beamer} + +%\usepackage{ngerman} +\usepackage{times} +\usepackage{graphicx} +\usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps} +\usepackage{amsmath,amssymb} +\usepackage[latin1]{inputenc} +\usepackage{listings,color} +\definecolor{lbcolor}{RGB}{255,210,150} +\lstset{ + language=C, + numbers=left, + stepnumber=1, + numbersep=5pt, + numberstyle=\tiny, + breaklines=true, + breakautoindent=true, + postbreak=\space, + tabsize=2, + basicstyle=\ttfamily\footnotesize, + showspaces=false, + showstringspaces=false, + extendedchars=true, + backgroundcolor=\color{lbcolor}, + keywordstyle=\bf , + commentstyle=\color{green}, + stringstyle=\color{red} +} + +\mode<presentation> +{ + \usetheme{linutronix} +} + +% on the following slides, include icon in the left sidebar +\def\lximg{/usr/share/lx/icons/fueller.png} + +\title{Network configuration} +\institute{Linutronix GmbH} + +\begin{document} + +\frame{ \titlepage } + +% stop displaying 'fueller.png' on the following slides +\def\lximg{none} + +\begin{frame}[fragile] +\frametitle{ifconfig} +\begin{verbatim} +# List all configured network devices +ifconfig +# List all available network devices +ifconfig -a +# Configure eth0 +ifconfig eth0 192.168.0.2 \ + netmask 255.255.255.0 up +# De-activate eth0 +ifconfig eth0 down +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Debian} +/etc/network/interfaces: +\begin{verbatim} +auto lo +iface lo inet loopback + +auto eth0 +iface eth0 inet static +address 192.168.2.1 +network 192.168.2.0 +netmask 255.255.255.0 +broadcast 192.168.2.255 +gateway 192.168.2.1 +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Debian} +/etc/network/interfaces: +\begin{verbatim} +auto lo +iface lo inet loopback + +auto eth0 +iface eth0 inet dhcp +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{SysFS attributes} +\begin{verbatim} +# Check the link status +$ cat /sys/class/net/eth0/carrier +1 +# Check the MAC address +$ cat /sys/class/net/eth0/address +00:0c:29:43:4b:69 +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{The ip tool} +\begin{verbatim} +# Show links +$ ip link list +# Show routes +$ ip route show +# Show the current ARP cache +$ ip neigh show +# Change the IP address +$ sudo ip addr change 192.168.0.3 dev eth0 +# Change the MAC address +$ ip link set eth0 address 00:0c:29:43:4b:ff +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{netcat: The TCP / IP swiss army knife} +\begin{verbatim} +# On the server +nc -l -p 5555 +# On the client +nc localhost 5555 +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{netcat: Testing connections} +\begin{verbatim} +$ nc some_web_server 80 +GET / HTTP/1.0 +[...] +$ nc -nv 192.168.0.1 22 +Connection to 192.168.0.1 22 port [tcp/*] +SSH-2.0-dropbear_0.48 +\end{verbatim} +\end{frame} + +\begin{frame} +\frametitle{Network sniffer} +\begin{itemize} +\item tcpdump +\item wireshark +\end{itemize} +\end{frame} + +\end{document} |
