Continue projet linux
This commit is contained in:
parent
74694156e1
commit
75a44cdfdb
1 changed files with 113 additions and 0 deletions
|
@ -12,6 +12,8 @@
|
|||
\maketitle
|
||||
\clearpage
|
||||
|
||||
\section{Introduction}
|
||||
|
||||
L'objectif de ce projet est de réaliser la topologie ci-dessous, en y respectant un cahier des charges précis~:
|
||||
|
||||
\includegraphics[width=\linewidth]{./img/archi.png}
|
||||
|
@ -181,9 +183,22 @@ Par contre, il faut comme pour \texttt{gateway} autoriser le routage~:
|
|||
iface ens4 inet dhcp
|
||||
\end{lstlisting}
|
||||
|
||||
\subsection{switch 1}
|
||||
|
||||
Nous avons configuré les VLANs sur le \texttt{firewall}, mais pas sur les équipements terminaux au sein de ces VLANs (\texttt{nfs}, \texttt{m1} et \texttt{m2}).
|
||||
Il faut configurer le \texttt{switch 1} pour taguer les VLANs et configurer un trunk entre le \texttt{switch 1} et le \texttt{firewall}~:
|
||||
|
||||
\begin{itemize}
|
||||
\item Le port 0 du \texttt{switch 1} est relié au \texttt{firewall}~: on le met en mode \texttt{dot1q}.
|
||||
\item Le port 1 du \texttt{switch 1} est relié à \texttt{m1}~: on le met en mode \texttt{access}, VLAN 10.
|
||||
\item Le port 2 du \texttt{switch 1} est relié à \texttt{m2}~: on le met en mode \texttt{access}, VLAN 10.
|
||||
\item Le port 3 du \texttt{switch 1} est relié à \texttt{nfs}~: on le met en mode \texttt{access}, VLAN 20.
|
||||
\end{itemize}
|
||||
|
||||
\section{Configuration du serveur DHCP}
|
||||
|
||||
Après avoir installé \texttt{isc-dhcp-server}~:
|
||||
|
||||
\texttt{/etc/default/isc-dhcp-server}
|
||||
\begin{lstlisting}[gobble=4]
|
||||
INTERFACESv4="ens4"
|
||||
|
@ -229,4 +244,102 @@ Par contre, il faut comme pour \texttt{gateway} autoriser le routage~:
|
|||
}
|
||||
\end{lstlisting}
|
||||
|
||||
Il faut ensuite permettre au \texttt{firewall}, qui agit en tant que routeur sur nos réseaux internes, de relayer les paquets DHCP~:
|
||||
|
||||
\begin{lstlisting}[gobble=4]
|
||||
apt install isc-dhcp-relay
|
||||
\end{lstlisting}
|
||||
|
||||
Puis modifier~:
|
||||
|
||||
\texttt{/etc/default/isc-dhcp-relay}
|
||||
\begin{lstlisting}[gobble=4]
|
||||
SERVERS="192.168.20.1"
|
||||
INTERFACES=""
|
||||
OPTIONS=""
|
||||
\end{lstlisting}
|
||||
|
||||
\section{Configuration du serveur DNS}
|
||||
|
||||
Après avoir installé \texttt{bind9}~:
|
||||
|
||||
\texttt{/etc/bind/named.conf.local}
|
||||
\begin{lstlisting}[gobble=4]
|
||||
zone "st-potache.fr" {
|
||||
type master;
|
||||
file "/etc/bind/db.st-potache.fr";
|
||||
};
|
||||
|
||||
zone "20.168.192.in-addr.arpa" {
|
||||
type master;
|
||||
file "/etc/bind/db.20.168.192";
|
||||
};
|
||||
|
||||
zone "40.168.192.in-addr.arpa" {
|
||||
type master;
|
||||
file "/etc/bind/db.40.168.192";
|
||||
};
|
||||
\end{lstlisting}
|
||||
|
||||
\texttt{/etc/bind/db.st-potache.fr}
|
||||
\begin{lstlisting}[gobble=4]
|
||||
$TTL 604800
|
||||
@ IN SOA localhost. root.localhost. (
|
||||
3 ; Serial
|
||||
604800 ; Refresh
|
||||
86400 ; Retry
|
||||
2419200 ; Expire
|
||||
604800 ) ; Negative Cache TTL
|
||||
;
|
||||
@ IN NS localhost.
|
||||
dhcp IN A 192.168.20.1
|
||||
dns IN A 192.168.20.2
|
||||
nfs IN A 192.168.40.1
|
||||
\end{lstlisting}
|
||||
|
||||
\texttt{/etc/bind/db.20.168.192}
|
||||
\begin{lstlisting}[gobble=4]
|
||||
$TTL 604800
|
||||
@ IN SOA localhost. root.localhost. (
|
||||
2 ; Serial
|
||||
604800 ; Refresh
|
||||
86400 ; Retry
|
||||
2419200 ; Expire
|
||||
604800 ) ; Negative Cache TTL
|
||||
;
|
||||
@ IN NS localhost.
|
||||
1 IN PTR dhcp
|
||||
2 IN PTR dns
|
||||
\end{lstlisting}
|
||||
|
||||
\texttt{/etc/bind/db.40.168.192}
|
||||
\begin{lstlisting}[gobble=4]
|
||||
$TTL 604800
|
||||
@ IN SOA localhost. root.localhost. (
|
||||
2 ; Serial
|
||||
604800 ; Refresh
|
||||
86400 ; Retry
|
||||
2419200 ; Expire
|
||||
604800 ) ; Negative Cache TTL
|
||||
;
|
||||
@ IN NS localhost.
|
||||
1 IN PTR nfs
|
||||
\end{lstlisting}
|
||||
|
||||
On peut vérifier que le \texttt{resolv.conf} contient bien l'adresse IP du serveur DNS (192.168.20.2), reçu partout par DHCP\@.
|
||||
|
||||
Après un \texttt{systemctl restart bind9}, on peut vérifier la résolution~:
|
||||
|
||||
\begin{console}[gobble=4]
|
||||
root@dns:~# ping nfs.st-potache.fr
|
||||
PING nfs.st-potache.fr (192.168.40.1) 56(84) bytes of data.
|
||||
64 bytes from nfs.40.168.192.in-addr.arpa (192.168.40.1): icmp_seq=1 ttl=63 time=1.20 ms
|
||||
64 bytes from nfs.40.168.192.in-addr.arpa (192.168.40.1): icmp_seq=2 ttl=63 time=2.49 ms
|
||||
64 bytes from nfs.40.168.192.in-addr.arpa (192.168.40.1): icmp_seq=3 ttl=63 time=2.54 ms
|
||||
^C
|
||||
--- nfs.st-potache.fr ping statistics ---
|
||||
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
|
||||
rtt min/avg/max/mdev = 1.196/2.076/2.540/0.622 ms
|
||||
\end{console}
|
||||
|
||||
\end{document}
|
||||
|
|
Loading…
Reference in a new issue