This repository has been archived by the owner on Aug 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Setting up network boot on a Linux Server
Michael Altobelli edited this page Jan 22, 2019
·
2 revisions
See any number of guides for this. I will be using Ubuntu 18.04.1 Server for the base below
- Install and enable DNSMasq
sudo apt install dnsmasq nginx
sudo systemctl enable dnsmasq
sudo systemctl enable nginx
- Create a custom config for DNSMasq, remember to change both of the included IP's to the one your server has
sudo nano /etc/dnsmasq.d-available/ipxe
#Disable DNS
port=0
#Set the below to your IP range
dhcp-range=192.168.43.0,proxy,255.255.255.0
#Filter out iPXE
dhcp-match=ipxe,175
#Change the below IP to your servers IP
pxe-service=tag:ipxe,X86PC,'Wipe',http://192.168.43.209/wipe.ipxe
pxe-service=tag:!ipxe,x86PC,"Load iPXE",undionly.kpxe
log-queries
#Setup TFTP server
enable-tftp
tftp-root=/var/ftpd/
- Enable the config
ln -s /etc/dnsmasq.d-available/ipxe /etc/dnsmasq.d/ipxe
- Start dnsmasq and create it's ftp directory
sudo mkdir -p /var/ftpd
sudo systemctl restart dnsmasq
- Download the iPXE Binary into the tftp root
sudo wget http://boot.ipxe.org/undionly.kpxe -O /var/ftpd/undionly.kpxe
- Download the DiskSlaw.iso (0.3 or higher)
wget https://github.com/maltob/DiskSlaw/releases/download/v0.3-alpha/diskslaw_0.3.iso -O diskslaw.iso
- Mount the iso so we can copy the files off it
sudo mkdir /mnt/diskslaw
sudo mount -o loop diskslaw.iso /mnt/diskslaw
- Copy the kernel, initrd and filesystem.squashfs into the nginx server directory
sudo cp /mnt/diskslaw/casper/{filesystem.squashfs,vmlinuz,initrd.lz} /var/www/html/
- Unmount the ISO
umount /mnt/diskslaw
umount /mnt/debian
- Create the iPXE file, again remember to replace the HTTP portion with your IP
nano /var/www/html/wipe.ipxe
#!ipxe
kernel http://192.168.43.209/vmlinuz
initrd http://192.168.43.209/initrd.lz
imgargs vmlinuz boot=live dhcp fetch=http://192.168.43.209/casper/filesystem.squashfs nouveau.modeset=0 nomodeset --
boot
- Start nginx
sudo systemctl start nginx
- Test your image works by booting a machine to network