PXE boot ?????? ?? Debian Jessie

????????? ???????????
vim /etc/apt/sources.list:

deb http://ftp.ua.debian.org/debian/ jessie main

aptitude update
aptitude install isc-dhcp-server tftpd-hpa apache2 samba iptables-persistent

??????? ????????????, ??? ??????? ????? ???????? tftp ??????
useradd -d /tftp -s /bin/false -c "tftp-user" -m tftp

??????????? tftp ??????
vim /etc/default/tftpd-hpa:

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftp"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--ipv4 --secure --create --umask 002 --permissive"

invoke-rc.d tftpd-hpa restart

?????????????? ????? ??? ???????? ?? ????
wget https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.zip
unzip syslinux-6.03.zip -d syslinux
cp syslinux/bios/core/pxelinux.0 /tftp
cp syslinux/bios/memdisk/memdisk /tftp
cp syslinux/bios/com32/chain/chain.c32 /tftp
cp syslinux/bios/com32/menu/menu.c32 /tftp
cp syslinux/bios/com32/mboot/mboot.c32 /tftp
cp syslinux/bios/com32/elflink/ldlinux/ldlinux.c32 /tftp
cp syslinux/bios/com32/libutil/libutil.c32 /tftp
mkdir -p /tftp/{pxelinux.cfg,images}
mkdir /tftp/images/{centos,debian,opensuse,win7,acronis}

mount -o loop CentOS-7.0-1406-x86_64-DVD.iso /mnt
cp -Rr /mnt/* /tftp/images/centos
umount /mnt

mount -o loop debian-testing-amd64-DVD-1.iso /mnt
cp -Rr /mnt/* /tftp/images/debian
umount /mnt
wget http://ftp.ua.debian.org/debian/dists/jessie/main/installer-amd64/current/images/netboot/debian-installer/amd64/{linux,initrd.gz} -P /tftp/images/debian/isolinux

mount -o loop openSUSE-13.2-DVD-x86_64.iso /mnt
cp -Rr /mnt/* /tftp/images/opensuse
umount /mnt
wget http://download.opensuse.org/distribution/13.2/repo/oss/boot/x86_64/loader/{linux,initrd} -P /tftp/images/opensuse

mount -o loop windows7x64.iso /mnt
cp -r /mnt/* /tftp/images/win7
umount /mnt

??????? ???? ??????? ??? Debian
vim /tftp/images/debian/isolinux/preseed.cfg:

d-i debian-installer/language string ru
d-i debian-installer/country string RU
d-i debian-installer/locale string ru_RU.UTF-8
d-i netcfg/choose_interface select auto
d-i clock-setup/utc boolean false
d-i time/zone string Europe/Moscow
tasksel tasksel/first multiselect standard, desktop
tasksel tasksel/desktop select xfce
d-i pkgsel/upgrade select full-upgrade
popularity-contest popularity-contest/participate boolean false
d-i cdrom-detect/eject boolean false

?????????? ??????????? ????? PXE ??? Windows 7
????????? ????? ?????????????? ????????? Windows http://download.microsoft.com/download/9/1/5/9153E40C-13C0-4A12-AB5A-7EB950ED9D6A/KB3AIK_RU.iso ? ????????????? ?? Windows 7
?? Windows 7 ????????? ????????? ?????? ??????? ????????????? ?? ?????????????? ? ?????? ???????:
mkdir c:\winpe
rd c:\winpe
copype.cmd amd64 c:\winpe
imagex /mountrw winpe.wim 1 mount

??????????? ?????? ??????? PXE C:\winpe\mount\Windows\System32\startnet.cmd:

wpeinit
net use z: \\192.168.0.1\pxe
z:\setup.exe

???? ? ??? ????? ?????? ? samba

wpeinit
net use z: \\192.168.0.1\pxe ????????? /user:???????????????
z:\setup.exe

? ??? ?? ????????? ?????? ??? ??????:

imagex /unmoumt mount /commit
copy "c:\Program Files\Windows AIK\Tools\amd64\imagex.exe" c:\winpe\ISO
copy c:\winpe\winpe.wim c:\winpe\ISO\sources\boot.wim
oscdimg -n -bc:\winpe\Etfsboot.com c:\winpe\ISO c:\winpe\win7pex64.iso

???????? ??????????????? ????? c:\winpe\win7pex64.iso ? ????? ??? ??????? /tftp/images/ ?? tftp ??????

????????? ?????-?????? ?????? Acronis ????????
wget http://tehnikpc.net/ftp/rescuecd/acronis/Acronis.2k10.UltraPack.v.3.0.5.iso -P /tftp/images/

??????? ???? ???????? PXE
vim /tftp/pxelinux.cfg/default:

default menu.c32
menu title pxe boot menu
prompt 0
timeout 1200
label Boot from local drive
        localboot
menu begin
menu title os install
label ..
menu exit
label   centos
        kernel images/centos/isolinux/vmlinuz
        append initrd=images/centos/isolinux/initrd.img method=http://192.168.0.1/pxe/centos/ devfs=nomount
label   debian
        kernel images/debian/isolinux/linux
        append priority=critical vga=normal initrd=images/debian/isolinux/initrd.gz ramdisk_size=32768 method=http:/192.168.0.1/pxe/debian/ preseed/url=http://192.168.0.1/pxe/debian/isolinux/preseed.cfg
label   opensuse
        kernel images/opensuse/linux
        append initrd=images/opensuse/initrd ramdisk_size=65536 splash=verbose showopts instmode=http netconfig=dhcp netdevice=eth0 install=http://192.168.0.1/pxe/opensuse/
label windows 7
        kernel memdisk
        append iso initrd=images/win7pex64.iso
menu end
menu begin
menu title utilities
label ..
menu exit
label   acronis
        kernel memdisk
        append iso initrd=images/Acronis.2k10.UltraPack.v.3.0.5.iso
menu end

????????? ?????? ? ?????? ????????????? Linux ?? HTTP
vim /etc/apache2/conf-enabled/pxe.conf:

Alias /pxe /tftp/images/
<Directory /tftp/images/>
        Options Indexes FollowSymLinks
        Require ip 192.168.0.0/24
</Directory>

invoke-rc.d apache2 reload

????????? ?????? ? ?????? Windows ?? SMB
vim /etc/samba/smb.conf:

[pxe$]
        path = /tftp/images/win7
        comment = windows 7 pxe install folder
        read only = yes
        guest ok = yes
        hosts allow = 192.168.0.0/24

invoke-rc.d samba restart

??????????? DHCP ??????
vim /etc/dhcp/dhcpd.conf:

authoritative;
option option-128 code 128 = string;
option option-129 code 129 = text;
allow booting;
allow bootp;
option domain-name "tehnikpc.net";
option domain-name-servers 192.168.0.1;
default-lease-time 720000;
max-lease-time 720000;
min-lease-time 720000;
log-facility local6;
subnet 192.168.0.0 netmask 255.255.255.0 {
        option routers 192.168.0.1;
        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.0.255;
        range dynamic-bootp 192.168.0.2 192.168.0.50;
        next-server 192.168.0.1;
        filename "pxelinux.0";
}

????????? ?????
iptables -I INPUT 1 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -I INPUT 2 -s 192.168.0.0/24 -d 192.168.0.1 -i eth0 -p tcp -m state --state NEW -m multiport --dports 80,445 -j ACCEPT
iptables -I INPUT 3 -s 192.168.0.0/24 -d 192.168.0.1 -i eth0 -p udp -m multiport --dports 67,69 -j ACCEPT
invoke-rc.d netfilter-persistent save

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *