-
run
./setup.sh
-
change directory to
/srv/pxe
-
create
./dnsmasq.conf
-
create
./pxelinux.cfg/default
-
bring up interface
sudo ip addr add 172.30.30.1/24 dev enp0s31f6 sudo ip link set enp0s31f6 up
-
add fireall rule
sudo nft add rule inet filter incoming iifname enp0s31f6 accept
-
start web server
sudo python3 -m http.server 80
-
start dnsmasq
sudo dnsmasq --conf-file=./dnsmasq.conf
Last active
November 12, 2021 08:27
-
-
Save dadevel/48e64e6a9b8a698d715ec488295b05c1 to your computer and use it in GitHub Desktop.
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
keep-in-foreground | |
log-facility=- | |
user=dnsmasq | |
group=dnsmasq | |
port=53 | |
server=8.8.8.8 | |
server=8.8.4.4 | |
no-resolv | |
no-hosts | |
interface=enp0s31f6 | |
bind-dynamic | |
dhcp-range=172.30.30.32,172.30.30.254,1h | |
dhcp-option=option:router,0.0.0.0 | |
dhcp-option=option:dns-server,0.0.0.0 | |
log-dhcp | |
# relative to tftp-root | |
pxe-prompt="Press F8 for menu or proceed with default in", 5 | |
dhcp-boot=pxelinux.0 | |
# enable-tftp | |
enable-tftp | |
tftp-root=/srv/pxe |
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
DEFAULT install | |
LABEL install | |
KERNEL vmlinuz | |
INITRD initrd | |
APPEND root=/dev/ram0 ramdisk_size=1500000 console=ttyS0,115200n8 ip=dhcp url=http://172.30.30.1/ubuntu.iso |
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
#!/usr/bin/env bash | |
set -eux | |
mkdir -p /srv/pxe | |
cd /srv/pxe | |
curl -L -o ./pxelinux.0 -C - http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/netboot/ubuntu-installer/amd64/pxelinux.0 | |
curl -L -o ./ubuntu.iso -C - https://releases.ubuntu.com/20.04.2/ubuntu-20.04.2-live-server-amd64.iso | |
sudo mount -o loop,ro ./ubuntu.iso /mnt | |
cp /mnt/casper/vmlinuz /mnt/casper/initrd . | |
sudo umount /mnt | |
sudo pacman -S core/syslinux | |
cp /usr/lib/syslinux/bios/ldlinux.c32 . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment