Créer un menu PXE pour l'installation Debian, Centos, Ubuntu et Memtest
Par Romain Tiennot le lundi 5 décembre 2011, 11:32 - Linux - Lien permanent
Je vais vous expliquer comment créer un serveur DHCP et PXE afin d'installer à partir du réseau différente distribution comme dans mon exemple Debian, Centos et Ubuntu. Il est possible d'intégrer des outils de diagnostic comme Memtest ou encore SystemRescueCd.
Pour mettre en place le serveur PXE, nous avons besoins :
- un DHCP
- un serveur TFTP
Pour ce faire, nous avons besoin d'installer les paquets suivant :
apt-get update apt-get upgrade apt-get install dhcp3-server tftpd-hpa
Il est préférable de mettre une IP statique à la carte réseau du serveur :
vi /etc/network/interfaces
auto eth0 iface eth0 inet static address 172.16.0.152 netmask 255.255.0.0 network 172.16.0.1 broadcast 172.16.255.255 gateway 172.16.0.254 dns-nameservers 172.16.0.254
Et de redémarrer le service réseau :
invoke-rc.d networking restart
Ensuite, il faut configurer le serveur DHCP pour qu'il puisse distribuer une configuration réseau notamment des informations pour le PXE :
vi /etc/dhcp/dhcpd.conf
ddns-update-style none; option domain-name "local.info"; default-lease-time 600; max-lease-time 7200; log-facility local7; subnet 172.16.0.0 netmask 255.255.255.0 { option broadcast-address 172.16.255.255; option routers 172.16.0.1; range 172.16.0.20 172.16.0.30; filename "pxelinux.0"; next-server 172.16.0.152;
Il faut ensuite créer l'arborescence :
mkdir -pv /srv/tftpboot/pxelinux.cfg /srv/tftpboot/image/debian/squeeze/i386 /srv/tftpboot/image/centos/5.7/ /srv/tftpboot/image/memtest/4.2/ /srv/tftpboot/image/ubuntu/11.10/ wget http://ftp.fr.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/boot-screens/vesamenu.c32 && mv vesamenu.c32 /srv/tftpboot/ wget http://ftp.fr.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/pxelinux.0 && mv pxelinux.0 /srv/tftpboot/
Puis télécharger les images des distributions qui serviront à l'installation :
DEBIAN wget http://ftp.fr.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/linux && mv linux /srv/tftpboot/image/debian/squeeze/i386/ wget http://ftp.fr.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz && mv initrd.gz /srv/tftpboot/image/debian/squeeze/i386/
UBUNTU wget http://fr.archive.ubuntu.com/ubuntu/dists/oneiric/main/installer-i386/current/images/netboot/ubuntu-installer/i386/linux && mv linux /srv/tftpboot/image/ubuntu/11.10/ wget http://fr.archive.ubuntu.com/ubuntu/dists/oneiric/main/installer-i386/current/images/netboot/ubuntu-installer/i386/initrd.gz && mv initrd.gz /srv/tftpboot/image/ubuntu/11.10/
CENTOS wget http://mirror.centos.org/centos-5/5.7/os/x86_64/images/pxeboot/vmlinuz && mv vmlinuz /srv/tftpboot/image/centos/5.7/ wget http://mirror.centos.org/centos-5/5.7/os/x86_64/images/pxeboot/initrd.img && mv initrd.img /srv/tftpboot/image/centos/5.7/
MEMTEST wget http://www.memtest.org/download/4.20/memtest86+-4.20.bin && mv memtest86+-4.20.bin /srv/tftpboot/image/memtest/4.2/memtest86+
Ensuite, nous allons créer le fichier "default" qui va nous permettre à créer le menu PXE :
vi /srv/tftpboot/pxelinux.cfg/default DEFAULT vesamenu.c32 menu background pxelinux.cfg/fond.png menu title Menu d'installation PXE prompt 0 timeout 100 noescape 1 allowoptions 0 LABEL Demarrage Disque Dur localboot 0 MENU BEGIN Debian MENU TITLE Debian LABEL Debian Squeeze 6.03 Installation kernel image/debian/squeeze/i386/linux append vga=normal initrd=image/debian/squeeze/i386/initrd.gz -- LABEL Debian Rescue kernel image/debian/squeeze/i386/linux append vga=normal initrd=image/debian/squeeze/i386/initrd.gz rescue/enable=true -- MENU END MENU BEGIN CentOS MENU TITLE CentOS LABEL CentOS 5.7 KS eth0 KERNEL image/centos/5.7/vmlinuz APPEND ks=http://172.16.0.152/centos5.ks initrd=image/centos/5.7/initrd.img MENU END MENU BEGIN Ubuntu MENU TITLE Ubuntu LABEL Ubuntu 11.10 KERNEL image/ubuntu/11.10/linux append vga=normal initrd=image/ubuntu/11.10/initrd.gz -- MENU END LABEL Diagnostique Memoire (Memtest) kernel image/memtest/4.2/memtest86+
Il est possible de mettre une image en fond d'écran :
wget http://romain.tiennot.fr/public/pxelinux/fond.png && mv fond.png /srv/tftpboot/pxelinux.cfg/
Après avoir relancé les services, Il vous reste à démarrer via le réseau et voir le résultat.
invoke-rc.d isc-dhcp-server start invoke-rc.d tftpd-hpa start
A bientôt,
Romain
Il y a 3 commentaires
You've made quite a few an awesome experience factors right now there. I appeared on the web to the issue and discovered most individuals will go as well as along with your web site.
There seriously are no "very good" or "negative" foods when it will come to pounds management accomplishment. Dropping fat speedy and in a healthier way is a desire that seems unachievable by quite a few persons.
z4root apk http://www.moviesafar.com/z4root.ht... z4root download