summaryrefslogtreecommitdiff
path: root/linux-basics/networking/pres_networking_en.tex
blob: b1fee464710f4f9edc72a23267437311bc876e71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
% on the following slides, include icon in the left sidebar
\def\lximg{/usr/share/lx/icons/fueller.png}

\input{configpres}

\title{Network Configuration}
\maketitle

% stop displaying 'fueller.png' on the following slides
\def\lximg{none}

\subsection{Network Configuration}

\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
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 Sniffers}
\begin{itemize}
\item tcpdump
\item wireshark
\end{itemize}
\end{frame}

\input{tailpres}