# sudo su
# apt-get install tftp-hpa tftpd-hpa dhcp3-server nfs-server portmap syslinux
редактируем:
# mcedit /etc/dhcp/dhcpd.conf
subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.20 192.168.10.40;
option domain-name-servers 192.168.10.1;
option domain-name "internal.design.tld";
option routers 192.168.10.1;
# option broadcast-address 10.5.5.31;
default-lease-time 600;
max-lease-time 7200;
# next-server 192.168.10.15; #если находится не на роутере
filename "/pxelinux.0";
}
-------------------------------------------------------------------------------------------------------------------
# mcedit /etc/default/tftpd-hpa
#TFTP_USERNAME="root"
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure --verbose"
RUN_DAEMON="yes" # возможно это не обязательно
-------------------------------------------------------------------------------------------------------------------
# mkdir /tftpboot
# mkdir /tftpboot/pxelinux.cfg
# mkdir /tftpboot/ubuntu1304
# mkdir /tftpboot/ubuntu1310
# cp /usr/lib/syslinux/vesamenu.c32 /tftpboot/
# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
-------------------------------------------------------------------------------------------------------------------
Необходимо указать интерфейс на котором будет вещать DHCP сервер:
# mcedit /etc/default/isc-dhcp-server
INTERFACES="eth0"
-------------------------------------------------------------------------------------------------------------------
# mcedit /tftpboot/pxelinux.cfg/default
DEFAULT vesamenu.c32
TIMEOUT 600
ONTIMEOUT BootLocal
PROMPT 0
label ubuntu 13.04
kernel ubuntu1304/casper/vmlinuz
append root=/dev/nfs root=/dev/nfs nfsroot=192.168.10.15:/tftpboot/ubuntu1304 netboot=nfs ro file=/ubuntu1304/preseed/ubuntu.seed boot=casper initrd=/ubuntu1304/casper/initrd.lz --
label ubuntu 13.10
kernel ubuntu1310/casper/vmlinuz
append root=/dev/nfs root=/dev/nfs nfsroot=192.168.10.15:/tftpboot/ubuntu1310 netboot=nfs ro file=/ubuntu1310/preseed/ubuntu.seed boot=casper initrd=/ubuntu1310/casper/initrd.lz --
--------------------------------------------------------
# mcedit /etc/exports
#nfs4 не работает 12.04
/tftpboot/ubuntu1304 *(ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure,no_subtree_check)
/tftpboot/ubuntu1310 *(ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure,no_subtree_check)
--------------------------------------------------------
монтируем iso в rc.local:
# mcedit /etc/rc.local
/home/wadmin/Archive/scripts/mount_iso.sh
--------------------------------------------------------
# mcedit /home/wadmin/Archive/scripts/mount_iso.sh
#!/bin/bash
umount /tftpboot/ubuntu1304
umount /tftpboot/ubuntu1310
mount -o loop /home/wadmin/Archive/iso/ubuntu-13.04-desktop-i386.iso /tftpboot/ubuntu1304
mount -o loop /home/wadmin/Archive/iso/ubuntu-13.10-desktop-i386.iso /tftpboot/ubuntu1310
# chmod -R 777 /home/wadmin/Archive/scripts/mount_iso.sh
пробуем
# /home/wadmin/Archive/scripts/mount_iso.sh
--------------------------------------------------------
назначаем права на все добро:
# chmod -R 777 /tftpboot
# service isc-dhcp-server restart
# service tftpd-hpa restart
# reboot
# apt-get install tftp-hpa tftpd-hpa dhcp3-server nfs-server portmap syslinux
редактируем:
# mcedit /etc/dhcp/dhcpd.conf
subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.20 192.168.10.40;
option domain-name-servers 192.168.10.1;
option domain-name "internal.design.tld";
option routers 192.168.10.1;
# option broadcast-address 10.5.5.31;
default-lease-time 600;
max-lease-time 7200;
# next-server 192.168.10.15; #если находится не на роутере
filename "/pxelinux.0";
}
-------------------------------------------------------------------------------------------------------------------
# mcedit /etc/default/tftpd-hpa
#TFTP_USERNAME="root"
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure --verbose"
RUN_DAEMON="yes" # возможно это не обязательно
-------------------------------------------------------------------------------------------------------------------
# mkdir /tftpboot
# mkdir /tftpboot/pxelinux.cfg
# mkdir /tftpboot/ubuntu1304
# mkdir /tftpboot/ubuntu1310
# cp /usr/lib/syslinux/vesamenu.c32 /tftpboot/
# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
-------------------------------------------------------------------------------------------------------------------
Необходимо указать интерфейс на котором будет вещать DHCP сервер:
# mcedit /etc/default/isc-dhcp-server
INTERFACES="eth0"
-------------------------------------------------------------------------------------------------------------------
# mcedit /tftpboot/pxelinux.cfg/default
DEFAULT vesamenu.c32
TIMEOUT 600
ONTIMEOUT BootLocal
PROMPT 0
label ubuntu 13.04
kernel ubuntu1304/casper/vmlinuz
append root=/dev/nfs root=/dev/nfs nfsroot=192.168.10.15:/tftpboot/ubuntu1304 netboot=nfs ro file=/ubuntu1304/preseed/ubuntu.seed boot=casper initrd=/ubuntu1304/casper/initrd.lz --
label ubuntu 13.10
kernel ubuntu1310/casper/vmlinuz
append root=/dev/nfs root=/dev/nfs nfsroot=192.168.10.15:/tftpboot/ubuntu1310 netboot=nfs ro file=/ubuntu1310/preseed/ubuntu.seed boot=casper initrd=/ubuntu1310/casper/initrd.lz --
--------------------------------------------------------
# mcedit /etc/exports
#nfs4 не работает 12.04
/tftpboot/ubuntu1304 *(ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure,no_subtree_check)
/tftpboot/ubuntu1310 *(ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure,no_subtree_check)
--------------------------------------------------------
монтируем iso в rc.local:
# mcedit /etc/rc.local
/home/wadmin/Archive/scripts/mount_iso.sh
--------------------------------------------------------
# mcedit /home/wadmin/Archive/scripts/mount_iso.sh
#!/bin/bash
umount /tftpboot/ubuntu1304
umount /tftpboot/ubuntu1310
mount -o loop /home/wadmin/Archive/iso/ubuntu-13.04-desktop-i386.iso /tftpboot/ubuntu1304
mount -o loop /home/wadmin/Archive/iso/ubuntu-13.10-desktop-i386.iso /tftpboot/ubuntu1310
# chmod -R 777 /home/wadmin/Archive/scripts/mount_iso.sh
пробуем
# /home/wadmin/Archive/scripts/mount_iso.sh
--------------------------------------------------------
назначаем права на все добро:
# chmod -R 777 /tftpboot
# service isc-dhcp-server restart
# service tftpd-hpa restart
# reboot