nouveau fichier : sio2/sisr/PXE/README.me
nouveau fichier : sio2/sisr/PXE/dhcpd.conf nouveau fichier : sio2/sisr/PXE/enp0s3 nouveau fichier : sio2/sisr/PXE/enp0s8 nouveau fichier : sio2/sisr/PXE/isc-dhcp-server nouveau fichier : sio2/sisr/PXE/nftables.conf
This commit is contained in:
parent
21252118e7
commit
0f6de50a66
38
sio2/sisr/PXE/README.me
Normal file
38
sio2/sisr/PXE/README.me
Normal file
@ -0,0 +1,38 @@
|
||||
# TP Déploiement PXE
|
||||
|
||||
## Description
|
||||
Ce projet décrit comment installer et configurer un serveur PXE (Preboot Execution Environment) pour permettre le démarrage de machines via le réseau.
|
||||
|
||||
## Prérequis
|
||||
- Un serveur avec une distribution Linux (par exemple, Ubuntu ou Debian)
|
||||
- Accès root ou sudo
|
||||
- Une connexion réseau fonctionnelle
|
||||
|
||||
## Installation
|
||||
|
||||
### Étape 1 : Installer les paquets nécessaires
|
||||
```
|
||||
sudo apt update
|
||||
sudo apt install -y isc-dhcp-server tftpd-hpa
|
||||
|
||||
### Étape 2 : Modifier le fichier isc-dhcp-server
|
||||
```
|
||||
--> Voir fichier dhcpd.conf
|
||||
|
||||
### Étape 3 : Configurer nftables
|
||||
```
|
||||
--> Voir /etc/nftables.conf
|
||||
|
||||
### Étape 4 : Configurer TFTP
|
||||
```
|
||||
YOURMIRROR=deb.debian.org
|
||||
Utiliser le script ci-dessous afin de récupérer l'image de netboot
|
||||
DIST=bookworm
|
||||
ARCH=amd64
|
||||
wget http://"$YOURMIRROR"/debian/dists/"$DIST"/main/installer-"$ARCH"/current/images/netboot/netboot.tar.gz
|
||||
|
||||
L'extraire dans /srv/tftp
|
||||
|
||||
|
||||
|
||||
|
15
sio2/sisr/PXE/dhcpd.conf
Normal file
15
sio2/sisr/PXE/dhcpd.conf
Normal file
@ -0,0 +1,15 @@
|
||||
default-lease-time 600;
|
||||
max-lease-time 7200;
|
||||
|
||||
allow booting;
|
||||
|
||||
# in this example, we serve DHCP requests from 192.168.0.(3 to 253)
|
||||
# and we have a router at 192.168.0.1
|
||||
subnet 192.168.1.0 netmask 255.255.255.0 {
|
||||
range 192.168.1.3 192.168.1.253;
|
||||
option broadcast-address 192.168.1.255;
|
||||
option routers 192.168.1.100; # our router
|
||||
option domain-name-servers 10.121.38.7; # our router has DNS functionality
|
||||
next-server 192.168.1.100; # our Server
|
||||
filename "pxelinux.0"; # setting a default, might be wrong for "non defaults"
|
||||
}
|
3
sio2/sisr/PXE/enp0s3
Normal file
3
sio2/sisr/PXE/enp0s3
Normal file
@ -0,0 +1,3 @@
|
||||
# generated by FAI
|
||||
auto enp0s3
|
||||
iface enp0s3 inet dhcp
|
4
sio2/sisr/PXE/enp0s8
Normal file
4
sio2/sisr/PXE/enp0s8
Normal file
@ -0,0 +1,4 @@
|
||||
# generated by FAI
|
||||
auto enp0s8
|
||||
iface enp0s8 inet static
|
||||
address 192.168.1.100/24
|
18
sio2/sisr/PXE/isc-dhcp-server
Normal file
18
sio2/sisr/PXE/isc-dhcp-server
Normal file
@ -0,0 +1,18 @@
|
||||
# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)
|
||||
|
||||
# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
|
||||
DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
|
||||
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf
|
||||
|
||||
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
|
||||
DHCPDv4_PID=/var/run/dhcpd.pid
|
||||
#DHCPDv6_PID=/var/run/dhcpd6.pid
|
||||
|
||||
# Additional options to start dhcpd with.
|
||||
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
|
||||
#OPTIONS=""
|
||||
|
||||
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
|
||||
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
|
||||
INTERFACESv4="enp0s8"
|
||||
#INTERFACESv6=""
|
14
sio2/sisr/PXE/nftables.conf
Normal file
14
sio2/sisr/PXE/nftables.conf
Normal file
@ -0,0 +1,14 @@
|
||||
#!/usr/sbin/nft -f
|
||||
|
||||
flush ruleset
|
||||
|
||||
table inet nat {
|
||||
chain prerouting {
|
||||
type nat hook prerouting priority 0;
|
||||
}
|
||||
chain postrouting {
|
||||
type nat hook postrouting priority 100;
|
||||
oifname "enp0s3" masquerade
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user