Tftp

Konfiguracja serwerów, usług, itp.
Awatar użytkownika
lankann
Posty: 2
Rejestracja: 26 stycznia 2015, 07:41

Tftp

Post autor: lankann »

Witam,

Znalazłem taki poradnik w sieci: http://jakilinux.org/linux/debian/insta ... rzez-siec/

Mam pytanie, czy można wgrać kilka obrazów systemów, np. Linux + Windows i wybrać w momencie instalacji jaki system instalujemy. Chodzi o możliwość postawienia serwera TFTP i skonfigurowanie kilku systemów w celu dalszej instalacji przez sieć lokalną LAN.

Z góry dziękuję za odp.
Awatar użytkownika
pawkrol
Moderator
Posty: 939
Rejestracja: 03 kwietnia 2011, 10:25

Post autor: pawkrol »

Oczywiście, że można. Osobiście polecam takie rozwiązanie: link
Dzięki temu projektowi, zaciągać obrazy możesz nie tylko protokołem tftp ale i http,iscsi,nfs. Genialna sprawa.
Awatar użytkownika
lankann
Posty: 2
Rejestracja: 26 stycznia 2015, 07:41

Post autor: lankann »

Fajne narzędzie a jakaś prosta ściągawka konfiguracyjna?

Dodane:

Ale narzędzie widzę, że bardzo fajne jest...
Awatar użytkownika
pawkrol
Moderator
Posty: 939
Rejestracja: 03 kwietnia 2011, 10:25

Post autor: pawkrol »

Nie pisz postów jeden pod drugim

Pokrótce
Kompilacja moduów ipxe:

Zależności

Kod: Zaznacz cały

aptitude install build-essential git genisoimage syslinux
git clone git://git.ipxe.org/ipxe.git
Dodanie protokołów https itp.. - usniecie //

Kod: Zaznacz cały

ipxe/src/config/general.h
#define      NET_PROTO_IPV6        /* IPv6 protocol */

#define      DOWNLOAD_PROTO_TFTP    /* Trivial File Transfer Protocol */
#define    DOWNLOAD_PROTO_HTTP    /* Hypertext Transfer Protocol */
#define    DOWNLOAD_PROTO_HTTPS    /* Secure Hypertext Transfer Protocol */
#define    DOWNLOAD_PROTO_FTP    /* File Transfer Protocol */
#define    DOWNLOAD_PROTO_SLAM    /* Scalable Local Area Multicast */
#define    DOWNLOAD_PROTO_NFS    /* Network File System Protocol */

#define      IMAGE_NBI            /* NBI image support */
#define    IMAGE_ELF        /* ELF image support */
#define    IMAGE_MULTIBOOT        /* MultiBoot image support */
#define    IMAGE_PXE        /* PXE image support */
#define    IMAGE_SCRIPT        /* iPXE script image support */
#define    IMAGE_BZIMAGE        /* Linux bzImage image support */
#define    IMAGE_COMBOOT        /* SYSLINUX COMBOOT image support */
//#define    IMAGE_EFI        /* EFI image support */
#define    IMAGE_SDI        /* SDI image support */
#define    IMAGE_PNM        /* PNM image support */
#define    IMAGE_PNG        /* PNG image support */

#define      AUTOBOOT_CMD        /* Automatic booting */
#define    NVO_CMD            /* Non-volatile option storage commands */
#define    CONFIG_CMD        /* Option configuration console */
#define    IFMGMT_CMD        /* Interface management commands */
#define    IWMGMT_CMD        /* Wireless interface management commands */
#define     FCMGMT_CMD        /* Fibre Channel management commands */
#define    ROUTE_CMD        /* Routing table management commands */
#define     IMAGE_CMD        /* Image management commands */
#define     DHCP_CMD        /* DHCP management commands */
#define     SANBOOT_CMD        /* SAN boot commands */
#define     MENU_CMD        /* Menu commands */
#define     LOGIN_CMD        /* Login command */
#define     _CMD            /* Sync command */
#define     NSLOOKUP_CMD        /* DNS resolving command */
#define     TIME_CMD        /* Time commands */
//#define     DIGEST_CMD        /* Image crypto digest commands */
#define     LOTEST_CMD        /* Loopback testing commands */
#define     VLAN_CMD        /* VLAN commands */
#define     PXE_CMD        /* PXE commands */
#define     REBOOT_CMD        /* Reboot command */
#define     POWEROFF_CMD        /* Power off command */
#define     IMAGE_TRUST_CMD    /* Image trust management commands */
#define    PCI_CMD        /* PCI commands */
#define     PARAM_CMD        /* Form parameter commands */
#define     NEIGHBOUR_CMD        /* Neighbour management commands */
#define     PING_CMD        /* Ping command */
#define    CONSOLE_CMD        /* Console command */

Dodanie obsługi port szeregowego oraz odbłsugi tła w png

Kod: Zaznacz cały

ipxe/src/config/console.h

#ifndef CONFIG_CONSOLE_H
#define CONFIG_CONSOLE_H

/** @file
 *
 * Console configuration
 *
 * These options specify the console types that Etherboot will use for
 * interaction with the user.
 *
 */

FILE_LICENCE ( GPL2_OR_LATER );

#include <config/defaults.h>

//#define    CONSOLE_PCBIOS        /* Default BIOS console */
#define    CONSOLE_SERIAL        /* Serial port */
//#define    CONSOLE_DIRECT_VGA    /* Direct access to VGA card */
//#define    CONSOLE_PC_KBD        /* Direct access to PC keyboard */
//#define    CONSOLE_SYSLOG        /* Syslog console */
//#define    CONSOLE_SYSLOGS        /* Encrypted syslog console */
//#define    CONSOLE_VMWARE        /* VMware logfile console */
//#define    CONSOLE_DEBUGCON    /* Debug port console */
#define    CONSOLE_VESAFB        /* VESA framebuffer console */

#define    KEYBOARD_MAP    us

#define    LOG_LEVEL    LOG_NONE

#include <config/local/console.h>

#endif /* CONFIG_CONSOLE_H */
Kompilacja

Kod: Zaznacz cały

[font=Courier New][size=84]cd ipxe/src[/size][/font]
[font=Courier New][size=84]make[/size][/font]
Po pomyślnej kompilacji w katalogu bin będziesz mieć pliki:

Kod: Zaznacz cały

ipxe.iso - bootowanie z plyty
ipxe.lkrn - bootwanie za pomoca gruba
ipxe.pxe - bootwanie z tftp 
undionly.kpxe bootwanie z tftp
DHCP

Kod: Zaznacz cały

ISC-DHCP

class "pxe" {
if exists user-class and option user-class = "iPXE" { filename "bootstrap.ipxe"; } else { filename "undionly.kpxe"; }
}

DNSMASQ

dhcp-match=set:ipxe,175 # iPXE sends a 175 option.
dhcp-option=175,8:1:1   # turn on the keep-san option to allow installation
dhcp-boot=tag:!ipxe,undionly.kpxe
dhcp-boot=bootstrap.ipxe
Plik bootstrap.ipxe

Kod: Zaznacz cały

#!ipxe

set adres_ip ${netX/next-server}
cpuid --ext 29 && set arch amd64 || set arch x86
set space:hex 20:20
set space ${space:string}
prompt --key 0x02 --timeout 1000 Press Ctrl-B for the iPXE command line... && shell ||

################################################### Menu Glowne ##########################################################################


:start

clear version
menu Wybierz system do uruchomienia 


item win7                 ${space} Instalacja windows 7
item win8                 ${space} Instalacja windows 8
item wheezy64             ${space} Instalacja Debian Wheezy 64BIT
item jessie32             ${space} Instalacja Debian Jessie 32BIT
item debian-live             ${space} Debian 7 Live (686-pae) LXDE Desktop
item
item --key 0x08 back Back to top menu...
choose selected && goto ${selected} || goto start


:debian-live
initrd http://${adres_ip}/boot/debian_live/initrd2.img
kernel http://${adres_ip}/boot/debian_live/vmlinuz2 boot=live netboot=nfs nfsroot=${adres_ip}:/mnt/dane/obrazy/nfs_ro/debian_live config splash locales=pl_PL.UTF-8
boot

:win7
cpuid --ext 29 && set arch amd64 || set arch x86
kernel wimboot/wimboot7/wimboot
initrd wimboot/wimboot7/bootmgr           bootmgr
initrd wimboot/wimboot7/bcd              BCD
initrd wimboot/wimboot7/boot.sdi         boot.sdi
initrd wimboot/wimboot7/${arch}/winpe.wim   boot.wim
boot

:win8
cpuid --ext 29 && set arch amd64 || set arch x86
kernel wimboot/wimboot8/wimboot
initrd wimboot/wimboot8/${arch}/bootmgr                      bootmgr
initrd wimboot/wimboot8/${arch}/boot/bcd                    BCD
initrd wimboot/wimboot8/${arch}/boot/fonts/segmono_boot.ttf  segmono_boot.ttf
initrd wimboot/wimboot8/${arch}/boot/fonts/segoe_slboot.ttf  segoe_slboot.ttf
initrd wimboot/wimboot8/${arch}/boot/fonts/segoen_slboot.ttf segoen_slboot.ttf
initrd wimboot/wimboot8/${arch}/boot/fonts/wgl4_boot.ttf     wgl4_boot.ttf
initrd wimboot/wimboot8/${arch}/boot/boot.sdi                boot.sdi
initrd wimboot/wimboot8/${arch}/sources/winpe.wim             boot.wim
boot


:wheezy64
kernel linux_install/debian-installer_whez64/amd64/linux vga=788 
initrd linux_install/debian-installer_whez64/amd64/initrd.gz 
boot


:jessie32
kernel linux_install/debian-installer_jessie32/i386/linux vga=788 
initrd linux_install/debian-installer_jessie32/i386/initrd.gz 
boot


############################################### Inne ##########################################################################



:linia
echo Type 'exit' to get the back to the menu
shell
set menu-timeout 0
set submenu-timeout 0
goto start
 

:reboot
reboot

:failed
echo Booting failed, uruchamiam powloke shell
goto linia

:exit
exit
ODPOWIEDZ