Skip to content

Instantly share code, notes, and snippets.

@darkn3rd
Last active September 10, 2015 18:12
Show Gist options
  • Save darkn3rd/34daf36445019267c515 to your computer and use it in GitHub Desktop.
Save darkn3rd/34daf36445019267c515 to your computer and use it in GitHub Desktop.

Kickstart

Setting up a PXE Server.

  • Environment
  • VirtualBox
  • Network - static
  • Disable Firewall, SELinux
  • Services
  • DHCP
  • tftp
  • syslinux
  • vsftpd

STEPS

  1. dhcpd
  • tftpd and xinetd
  • syslinux (pxelinux, menu, memdisk, chain)
  • tftpboot (netboot)
  • install media (vmlinux, initrd.img)
  • kickstart file
  • menu file

DETAILS

DHCP Server

ddns-update-style intermim;
ignore client-updates;
authoritative;
allow booting;
allow bootp;
allow-unknown clients;

##### Internet Subnet
subnet 10.1.1.0 mask 255.255.255.0 {
  range 10.1.1.50 10.1.1.253
  option domain-name-servers 10.1.1.223;
  option domain-name "webegoblins.dev";
  option routers 10.1.1.223;
  default-lease-time 600;
  max-leaase-time 7200;

  #### PXE Server IP
  next-server 10.1.1.223
  filename "pxelinux.0"
}

Install Media

wget http://mirror.rackspace.com/CentOS/7/isos/x86_64/CentOS-7-x86_64-DVD-1503-01.iso

Kickstart File

install
lang en_GB.UTF-8
keyboard us
timezone America/Chicago
auth --useshadow --enablemd5
selinux --disabled
firewall --disabled
services --enabled=NetworkManager, sshd
eula --agreed
### FTP Location
url --url="ftp://10.1.1.223/pub"

bootloader --location=mbr
zerombr
clearpart --all --initlabel
part swap --asprimary --fstype="swap" --size=1024
part /boot --fstype xfs --size=200
part pv.01 --size=1 --grow
volgroup rootvg01 pv.01
logvol / --fstype xfs --name=lv01 --vgname=rootvg01 --size=1 --grow
rootpw --iscrypted <password>

%packages --nobase --ignoremissing
@core
%end

MENU

default menu.c32
prompt 0
timeout 300
MENU TITLE WeBeGoblins PXE Menu

LABEL centos7_x64
MENU LABEL CentOS 7 X64
KERNEL netboot/vmlinuz
APPEND initrd=netboot/initrd.img inst.repo=ftp://10.1.1.223/pub ks=ftp://10.1.1.223/pub/ks.cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment