PXE

From Hobbynet Admin Wiki
Revision as of 21:56, 21 April 2014 by Egbert (talk | contribs) (→‎dhcpd)
Jump to navigation Jump to search

pxe

Op de virtuele server 'pxe' draait een PXE-server voor installatie van debian op afstand.

Er wordt door middel van dhcp een extern IP adres uitgedeeld waarmee je een server kan herinstalleren.

Op deze pagina staat complete installatie handleiding: http://www.howtoforge.com/ubuntu_pxe_install_server

tftp

De tftp boot files staan in /var/lib/tftpboot

dhcpd

De dhcp server deelt in drie reeksen uit:

1 in de 2e interne reeks 172.31.1.0/24 van 172.31.1.140 tot 172.31.1.170
2 in de externe reeks 212.72.224.0/26 van 212.72.224.200 tot 212.72.224.210
3 in de externe reeks 212.72.229.0/26 van 212.72.224.200 tot 212.72.229.210

De config van dhcp

default-lease-time 600;
max-lease-time 600;

authoritative;

subnet 172.31.1.0 netmask 255.255.255.0 {
        range 172.31.1.140 172.31.1.170;
        filename "pxelinux.0";
        option domain-name "hobby.nl";
        option subnet-mask 255.255.255.0;
        option domain-name-servers 172.31.1.13, 172.31.1.14;
        option routers 172.31.1.254;
 }

subnet 212.72.224.0 netmask 255.255.255.0 {
        range 212.72.224.200 212.72.224.210;
        filename "pxelinux.0";
        option domain-name "hobby.nl";
        option subnet-mask 255.255.255.0;
        option domain-name-servers 212.72.224.3, 212.72.224.4;
        option routers 212.72.224.1;
 }

subnet 212.72.229.0 netmask 255.255.255.0 {
        range 212.72.229.200 212.72.229.210;
        filename "pxelinux.0";
        option domain-name "hobby.nl";
        option subnet-mask 255.255.255.0;
        option domain-name-servers 212.72.224.3, 212.72.224.4;
        option routers 212.72.229.1;
 }

De client kant

Neem in de lokale DHCP server op:

subnet 192.168.10.0 netmask 255.255.255.0 {
   range 192.168.10.170 192.168.10.199;
   option subnet-mask 255.255.255.0;
   option broadcast-address 192.168.10.255;
   option routers 192.168.10.1;
   filename "pxelinux.0";
   next-server 212.72.224.24;

Het gaat om de laatste twee regels; "filename" en "next-server".

distributies

De globale bestanden voor alle distributies staan in /var/lib/tftpboot/pxelinux.cfg/

ubuntu

Versie 12.04

De installatie bestanden staan in /var/lib/tftpboot/ubuntu-installer-1204

Versie 12.10

De installatie bestanden staan in /var/lib/tftpboot/ubuntu-installer-1210

Versie 13.04

De installatie bestanden staan in /var/lib/tftpboot/ubuntu-installer-1304

Versie 13.10

De installatie bestanden staan in /var/lib/tftpboot/ubuntu-installer-1310

Versie 14.04

De installatie bestanden staan in /var/lib/tftpboot/ubuntu-installer-1404

Images ophalen van externe server

De boot images worden m.b.v. het script '/var/lib/tftpboot/ubuntu-installer-1404/temp/update' van een externe server opgehaald.

cd /var/lib/tftpboot/ubuntu-installer-1404/temp/
lftp -c "open http://nl.archive.ubuntu.com/ubuntu/dists/lucid/main/installer-i386/current/images/; mirror netboot/"
lftp -c "open http://nl.archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/; mirror netboot/"
rm -fr /var/lib/tftpboot/ubuntu-installer-1404/amd64
rm -fr /var/lib/tftpboot/ubuntu-installer-1404/i386
mv netboot/ubuntu-installer/* /var/lib/tftpboot/ubuntu-installer-1404/
rm -fr netboot 

debian

Versie 5.0

De installatie bestanden staan in /var/lib/tftpboot/debian-installer-50

fedora

Versie 11

Bestands locaties

De installatie bestanden staan in /var/lib/tftpboot/fedora-installer-11

Fedora configuratie scripts

In /var/www staan 2 configuratie scripts (kickstart) een voor 32 bit en 64 bit. In deze scripts staat de URL van de mirror, zodat de gebruiker vanaf daar kan installeren.
Hieronder een voorbeeld van zo'n bestand:

network --device eth0 --bootproto dhcp
#Use HTTP installation media
url --url=http://mirror.leaseweb.com/fedora/linux/releases/11/Fedora/x86_64/os

OpenSuse versie 12.2

Bestandslocaties

De installatie bestanden staan in /var/lib/tftpboot/fedora-installer-122

OpenSuse nersie 13.1

Bestandslocaties

De installatie bestanden staan in /var/lib/tftpboot/fedora-installer-131

Fedora configuratie scripts

In /var/www staan 2 configuratie scripts (kickstart) een voor 32 bit en 64 bit. In deze scripts staat de URL van de mirror, zodat de gebruiker vanaf daar kan installeren.
Hieronder een voorbeeld van zo'n bestand:

network --device eth0 --bootproto dhcp
#Use HTTP installation media
url --url=http://mirror.leaseweb.com/fedora/linux/releases/12/Fedora/x86_64/os
Images ophalen van externe server

De boot images worden m.b.v. het script '/var/lib/tftpboot/fedora-installer-12/work/get_all' van een externe server opgehaald.

#! /bin/bash
cd /var/lib/tftpboot/fedora-installer-12/work/
lftp -c "open http://download.fedora.redhat.com/pub/fedora/linux/releases/12/Fedora/i386/os/images/; mirror pxeboot/"
rm -rf ../i386
mv pxeboot ../i386
lftp -c "open http://download.fedora.redhat.com/pub/fedora/linux/releases/12/Fedora/x86_64/os/images/; mirror pxeboot/"
rm -rf ../x86_64
mv pxeboot ../x86_64

CentOS

Versie 5.3

Bestands locaties

De installatie bestanden staan in /var/lib/tftpboot/centos-installer-53

Configuratie scripts

In /var/www staan 2 configuratie scripts (kickstart) een voor 32 bit en 64 bit. In deze scripts staat de URL van de mirror, zodat de gebruiker vanaf daar kan installeren.
Hieronder een voorbeeld van zo'n bestand:

network --device eth0 --bootproto dhcp
#Use HTTP installation media
url --url=ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/centos/5.3/os/x86_64/