HW: 2 nic device
OS: Ubuntu server 17.10
apt install bash debootstrap schroot syslinux nfs-kernel-server tftpd-hpa xorriso pigz zfsutils-linux
Optional config
apt install isc-dhcp-server
network config nano /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: no
addresses: [10.1.22.2/24]
gateway4: 192.168.122.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
ens4:
dhcp4: yes
zpool create livenet /dev/sdb
zfs create livenet/images
zfs create livenet/boot
Download package git clone https://github.com/scipioni/livenet-server.git edit /etc/default/livenet like this
# folder that contains livenet system
BASE=/livenet
IMAGES=${BASE}/images
BOOT=${BASE}/boot
edit /etc/default/tftp-hpa
TFTP_USERNAME="tftp" TFTP_DIRECTORY="/zfsp_livenet/boot" TFTP_ADDRESS="0.0.0.0:69" TFTP_OPTIONS="--secure"
Editare la riga in
/etc/default/isc-dhcp-server
INTERFACESv4="ens3"
editare il file /etc/dhcp/dhcpd.conf al termine service isc-dhcp-service restart
ddns-update-style none;
authoritative;
option domain-name "livenet";
option domain-name-servers 8.8.8.8;
allow bootp;
allow booting;
option space PXE;
# Code 1: Multicast IP address of bootfile
option PXE.mtftp-ip code 1 = ip-address;
# Code 2: UDP port that client should monitor for MTFTP responses
option PXE.mtftp-cport code 2 = unsigned integer 16;
# Code 3: UDP port that MTFTP servers are using to listen for MTFTP requests
option PXE.mtftp-sport code 3 = unsigned integer 16;
# Code 4: Number of secondes a client must listen for activity before trying
# to start a new MTFTP transfer
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
# Code 5: Number of secondes a client must listen before trying to restart
# a MTFTP transfer
option PXE.discovery-control code 6 = unsigned integer 8;
option PXE.discovery-mcast-addr code 7 = ip-address;
set vendor-string = option vendor-class-identifier;
class "PXE" {
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
option vendor-class-identifier "PXEClient";
vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;
}
class "Etherboot" {
match if substring(option vendor-class-identifier, 0, 9) = "Etherboot";
option vendor-class-identifier "Etherboot";
vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;
}
class "LIVENET" {
match if (substring(option vendor-class-identifier,0,7) = "LIVENET") or (substring(option vendor-class-identifier,0,9) = "PXEClient") or (substring(option vendor-class-identifier,0,9) = "Etherboot");
log ( info, "Packet from PXE or LIVENET client");
}
shared-network "clients" {
subnet 10.1.22.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option routers 10.1.22.2;
#default-lease-time 28800;
#max-lease-time 86400;
pool {
# restringe il lease solo alla classe LIVENET
allow members of "LIVENET";
range 10.1.22.10 10.1.22.100;
filename "/pxelinux.0";
next-server 10.1.22.2;
}
}
}