Created
October 31, 2018 20:00
-
-
Save wapiflapi/942acab07874ca83bbf03941a7f92818 to your computer and use it in GitHub Desktop.
Quick and dirty PXE boot server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p /tmp/tftp | |
wget https://boot.netboot.xyz/ipxe/netboot.xyz.efi -O /tmp/tftp/netboot.xyz.efi | |
# /!\ Make sure the router is OK. | |
ROUTER=$(ip r | grep default | cut -d ' ' -f3) | |
# Make sure interface is the right one, | |
# and dhcp-range should be a subset of the real range. | |
cat > /tmp/dnsmasq.conf <<EOF | |
interface=enp0s31f6 | |
bind-interfaces | |
dhcp-option=option:router,$ROUTER | |
dhcp-range=192.168.1.120,192.168.1.140 | |
dhcp-boot=netboot.xyz.efi | |
enable-tftp | |
tftp-root=/tmp/tftp/ | |
EOF | |
dnsmasq --conf-file=/tmp/dnsmasq.conf --no-daemon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment