Skip to content

Instantly share code, notes, and snippets.

@yuuichi-fujioka
Last active August 29, 2015 14:15
Show Gist options
  • Save yuuichi-fujioka/e9ac9ab4a2280412e74e to your computer and use it in GitHub Desktop.
Save yuuichi-fujioka/e9ac9ab4a2280412e74e to your computer and use it in GitHub Desktop.
pxeboot config files on ubuntu 14.04
# /var/lib/tftpboot/pxelinux.cfg/default
default syslinux/vesamenu.c32
menu hshift 13
menu width 49
menu margin 8
menu title Installer boot menu
# example, for CoreOS
label CoreOS
kernel coreos-installer/coreos_production_pxe.vmlinuz
append initrd=coreos-installer/coreos_production_pxe_image.cpio.gz cloud-config-url=http://172.16.254.1/pxe-cloud-config.yml
# /etc/dhcp/dhcpd.conf
ddns-update-style none;
option domain-name "example.local";
option domain-name-servers example.local;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;
subnet 172.16.254.0 netmask 255.255.255.0 {
range 172.16.254.100 172.16.254.200;
option domain-name "example.local";
option domain-name-servers example.local;
option broadcast-address 172.16.254.255;
default-lease-time 600;
max-lease-time 7200;
}
allow booting;
allow bootp;
option option-128 code 128 = string;
option option-129 code 129 = text;
next-server 172.16.254.1;
filename "pxelinux.0";
apt-get install isc-dhcp-server nginx tftpd-hpa inetutils-inetd syslinux -y
cp /usr/lib/syslinux/pxelinux.0 /var/lib/tftpboot/
mkdir /var/lib/tftpboot/syslinux
cp /usr/lib/syslinux/vesamenu.c32 /var/lib/tftpboot/syslinux/
# Example, store CoreOS installer
cd /var/lib/tftpboot/
mkdir coreos-installer
cd coreos-installer
wget http://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe.vmlinuz
wget http://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe.vmlinuz.sig
wget http://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe_image.cpio.gz
wget http://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe_image.cpio.gz.sig
#/etc/network/interfaces
auto eth1
iface eth1 inet static
address 172.16.254.1
netmask 255.255.255.0
network 172.16.254.0
broadcast 172.16.254.255
# /etc/default/isc-dhcp-server
INTERFACES="eth1"
#cloud-config
# /usr/share/nginx/html/pxe-cloud-config.yml
# for coreos installer
coreos:
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC61DSZpVJ0O2C6g7pZ6xGPxOerborOuvYwFv28eQMLGV9UACgp0/6GvZBRrFoTod7XVXZ/VuYi8RvZSWv67mPrsNrohCBKNuRI2JQFPef0Xc5biq6ADyuMJ7pjVCmQ7aNsTqTJ0mbzW30ifrI0GigWhRdD2DKI6U6M9EcLQKdhfLAZhHx+QTPmDmBcq+M42NA0QM6yYipD9JPTyXY+O8EI4ReqtOiIk2w7PzvaobR8n48TUyScqrndsDS4wCFChTVH9apnrph/btcOP8vLBvPMteah8mFtcWaG3mpGTlYp24YFMzpcadiFeMizwgwte1VPVbz0zSngnW/0+Hi0SK4D
# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/lib/tftpboot"
TFTP_ADDRESS="[::]:69"
TFTP_OPTIONS="--secure"
RUN_DAEMON="yes"
OPTIONS="-l -s /var/lib/tftpboot"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment