PXE SETUP

[root@foundation49 dhcp]# vim dhcpd.conf [root@foundation49 dhcp]# yum install tftp-server Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Resolving Dependencies --> Running transaction check ---> Package tftp-server.x86_64 0:5.2-12.el7 will be installed --> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================

Package Arch Version Repository Size

Installing: tftp-server x86_64 5.2-12.el7 rhel-dvd 44 k

Transaction Summary

Install 1 Package

Total download size: 44 k Installed size: 60 k Is this ok [y/d/N]: y Downloading packages: tftp-server-5.2-12.el7.x86_64.rpm | 44 kB 00:00:00
Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : tftp-server-5.2-12.el7.x86_64 1/1 Verifying : tftp-server-5.2-12.el7.x86_64 1/1

Installed: tftp-server.x86_64 0:5.2-12.el7

Complete! [root@foundation49 dhcp]# vim /etc/xinetd.d/tftp [root@foundation49 dhcp]# netstat -ulnp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
udp 0 0 0.0.0.0:50919 0.0.0.0: 8408/dhcpd
udp 0 0 192.168.122.1:53 0.0.0.0:
1041/dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0: 8408/dhcpd
udp 0 0 0.0.0.0:67 0.0.0.0:
1041/dnsmasq
udp 0 0 127.0.0.1:323 0.0.0.0: 584/chronyd
udp 0 0 0.0.0.0:5353 0.0.0.0:
634/avahi-daemon: r udp 0 0 0.0.0.0:50725 0.0.0.0: 634/avahi-daemon: r udp6 0 0 :::6415 ::: 8408/dhcpd
udp6 0 0 ::1:323 :::* 584/chronyd
[root@foundation49 dhcp]# systemctl start xinetd Failed to start xinetd.service: Unit xinetd.service failed to load: No such file or directory. [root@foundation49 dhcp]# /etc/init.d/xinetd start -bash: /etc/init.d/xinetd: 沒有此一檔案或目錄 [root@foundation49 dhcp]# ll /etc/rc.d/init.d/ 總計 36 -rw-r--r--. 1 root root 13948 Sep 16 2015 functions -rwxr-xr-x. 1 root root 2989 Sep 16 2015 netconsole -rwxr-xr-x. 1 root root 6630 Sep 16 2015 network -rw-r--r--. 1 root root 1160 Oct 12 2015 README -rwxr-xr-x. 1 root root 2437 Jun 26 2015 rhnsd [root@foundation49 dhcp]# systemctl status tftp.s tftp.service tftp.socket
[root@foundation49 dhcp]# systemctl status tftp.service ● tftp.service - Tftp Server Loaded: loaded (/usr/lib/systemd/system/tftp.service; indirect; vendor preset: disabled) Active: inactive (dead) Docs: man:in.tftpd [root@foundation49 dhcp]# systemctl start tftp.service [root@foundation49 dhcp]# systemctl status tftp.service ● tftp.service - Tftp Server Loaded: loaded (/usr/lib/systemd/system/tftp.service; indirect; vendor preset: disabled) Active: active (running) since Mon 2016-11-21 21:01:33 CST; 4s ago Docs: man:in.tftpd Main PID: 12961 (in.tftpd) CGroup: /system.slice/tftp.service └─12961 /usr/sbin/in.tftpd -s /var/lib/tftpboot

Nov 21 21:01:33 foundation49.ilt.example.com systemd[1]: Started Tftp Server. Nov 21 21:01:33 foundation49.ilt.example.com systemd[1]: Starting Tftp Server... [root@foundation49 dhcp]# netstat -ulnp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
udp 0 0 0.0.0.0:50919 0.0.0.0: 8408/dhcpd
udp 0 0 192.168.122.1:53 0.0.0.0:
1041/dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0: 8408/dhcpd
udp 0 0 0.0.0.0:67 0.0.0.0:
1041/dnsmasq
udp 0 0 127.0.0.1:323 0.0.0.0: 584/chronyd
udp 0 0 0.0.0.0:5353 0.0.0.0:
634/avahi-daemon: r udp 0 0 0.0.0.0:50725 0.0.0.0: 634/avahi-daemon: r udp6 0 0 :::6415 ::: 8408/dhcpd
udp6 0 0 :::69 ::: 1/systemd
udp6 0 0 ::1:323 :::
584/chronyd
[root@foundation49 dhcp]# cd /var/lib/tftpboot/ [root@foundation49 tftpboot]# ll 總計 0 [root@foundation49 tftpboot]# yum install syslinux Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Package syslinux-4.05-12.el7.x86_64 already installed and latest version Nothing to do [root@foundation49 tftpboot]# rpm -ql syslinux /usr/bin/gethostip /usr/bin/isohybrid /usr/bin/memdiskfind /usr/bin/syslinux /usr/share/doc/syslinux-4.05 /usr/share/doc/syslinux-4.05/COPYING /usr/share/doc/syslinux-4.05/CodingStyle.txt /usr/share/doc/syslinux-4.05/NEWS /usr/share/doc/syslinux-4.05/README /usr/share/doc/syslinux-4.05/SubmittingPatches.txt /usr/share/doc/syslinux-4.05/comboot.txt /usr/share/doc/syslinux-4.05/distrib.txt /usr/share/doc/syslinux-4.05/extlinux.txt /usr/share/doc/syslinux-4.05/gpt.txt /usr/share/doc/syslinux-4.05/isolinux.txt /usr/share/doc/syslinux-4.05/keytab-lilo.txt /usr/share/doc/syslinux-4.05/logo /usr/share/doc/syslinux-4.05/logo/syslinux-100.png /usr/share/doc/syslinux-4.05/mboot.txt /usr/share/doc/syslinux-4.05/memdisk.txt /usr/share/doc/syslinux-4.05/menu.txt /usr/share/doc/syslinux-4.05/pxelinux.txt /usr/share/doc/syslinux-4.05/rfc5071.txt /usr/share/doc/syslinux-4.05/sample /usr/share/doc/syslinux-4.05/sample/Makefile /usr/share/doc/syslinux-4.05/sample/m16-640x640-syslinux.jpg /usr/share/doc/syslinux-4.05/sample/sample.msg /usr/share/doc/syslinux-4.05/sample/syslinux_splash.jpg /usr/share/doc/syslinux-4.05/sample/syslogo.lss /usr/share/doc/syslinux-4.05/sample/syslogo.ppm.gz /usr/share/doc/syslinux-4.05/sdi.txt /usr/share/doc/syslinux-4.05/syslinux.txt /usr/share/doc/syslinux-4.05/usbkey.txt /usr/share/man/man1/gethostip.1.gz /usr/share/man/man1/isohybrid.1.gz /usr/share/man/man1/memdiskfind.1.gz /usr/share/man/man1/syslinux.1.gz /usr/share/man/man1/syslinux2ansi.1.gz /usr/share/syslinux /usr/share/syslinux/altmbr.bin /usr/share/syslinux/altmbr_c.bin /usr/share/syslinux/altmbr_f.bin /usr/share/syslinux/cat.c32 /usr/share/syslinux/chain.c32 /usr/share/syslinux/cmd.c32 /usr/share/syslinux/config.c32 /usr/share/syslinux/cpuid.c32 /usr/share/syslinux/cpuidtest.c32 /usr/share/syslinux/diag /usr/share/syslinux/diag/geodsp1s.img.xz /usr/share/syslinux/diag/geodspms.img.xz /usr/share/syslinux/diag/handoff.bin /usr/share/syslinux/disk.c32 /usr/share/syslinux/dmitest.c32 /usr/share/syslinux/dosutil /usr/share/syslinux/dosutil/copybs.com /usr/share/syslinux/dosutil/eltorito.sys /usr/share/syslinux/dosutil/mdiskchk.com /usr/share/syslinux/elf.c32 /usr/share/syslinux/ethersel.c32 /usr/share/syslinux/gfxboot.c32 /usr/share/syslinux/gptmbr.bin /usr/share/syslinux/gptmbr_c.bin /usr/share/syslinux/gptmbr_f.bin /usr/share/syslinux/gpxecmd.c32 /usr/share/syslinux/gpxelinux.0 /usr/share/syslinux/gpxelinuxk.0 /usr/share/syslinux/hdt.c32 /usr/share/syslinux/host.c32 /usr/share/syslinux/ifcpu.c32 /usr/share/syslinux/ifcpu64.c32 /usr/share/syslinux/ifplop.c32 /usr/share/syslinux/int18.com /usr/share/syslinux/isohdpfx.bin /usr/share/syslinux/isohdpfx_c.bin /usr/share/syslinux/isohdpfx_f.bin /usr/share/syslinux/isohdppx.bin /usr/share/syslinux/isohdppx_c.bin /usr/share/syslinux/isohdppx_f.bin /usr/share/syslinux/isolinux-debug.bin /usr/share/syslinux/isolinux.bin /usr/share/syslinux/kbdmap.c32 /usr/share/syslinux/linux.c32 /usr/share/syslinux/ls.c32 /usr/share/syslinux/lua.c32 /usr/share/syslinux/mboot.c32 /usr/share/syslinux/mbr.bin /usr/share/syslinux/mbr_c.bin /usr/share/syslinux/mbr_f.bin /usr/share/syslinux/memdisk /usr/share/syslinux/memdump.com /usr/share/syslinux/meminfo.c32 /usr/share/syslinux/menu.c32 /usr/share/syslinux/pcitest.c32 /usr/share/syslinux/pmload.c32 /usr/share/syslinux/poweroff.com /usr/share/syslinux/pwd.c32 /usr/share/syslinux/pxechain.com /usr/share/syslinux/pxelinux.0 /usr/share/syslinux/reboot.c32 /usr/share/syslinux/rosh.c32 /usr/share/syslinux/sanboot.c32 /usr/share/syslinux/sdi.c32 /usr/share/syslinux/sysdump.c32 /usr/share/syslinux/syslinux.com /usr/share/syslinux/syslinux.exe /usr/share/syslinux/syslinux64.exe /usr/share/syslinux/ver.com /usr/share/syslinux/vesainfo.c32 /usr/share/syslinux/vesamenu.c32 /usr/share/syslinux/vpdtest.c32 /usr/share/syslinux/whichsys.c32 /usr/share/syslinux/zzjson.c32 [root@foundation49 tftpboot]# ll 總計 0 [root@foundation49 tftpboot]# cp /usr/share/syslinux/pxelinux.0 /usr/share/syslinux/menu.c32 /usr/share/syslinux/memdisk /usr/share/syslinux/mboot.c32 /usr/share/syslinux/chain.c32 . [root@foundation49 tftpboot]# mkdir pxelinux.cfg [root@foundation49 tftpboot]# ll 總計 172 -rw-r--r--. 1 root root 20832 Nov 21 21:08 chain.c32 -rw-r--r--. 1 root root 33756 Nov 21 21:08 mboot.c32 -rw-r--r--. 1 root root 26268 Nov 21 21:08 memdisk -rw-r--r--. 1 root root 55140 Nov 21 21:08 menu.c32 -rw-r--r--. 1 root root 26748 Nov 21 21:08 pxelinux.0 drwxr-xr-x. 2 root root 6 Nov 21 21:09 pxelinux.cfg [root@foundation49 tftpboot]# cd pxelinux.cfg/ [root@foundation49 pxelinux.cfg]# cd .. [root@foundation49 tftpboot]# ll 總計 172 -rw-r--r--. 1 root root 20832 Nov 21 21:08 chain.c32 -rw-r--r--. 1 root root 33756 Nov 21 21:08 mboot.c32 -rw-r--r--. 1 root root 26268 Nov 21 21:08 memdisk -rw-r--r--. 1 root root 55140 Nov 21 21:08 menu.c32 -rw-r--r--. 1 root root 26748 Nov 21 21:08 pxelinux.0 drwxr-xr-x. 2 root root 6 Nov 21 21:09 pxelinux.cfg [root@foundation49 tftpboot]# mkdir rhel72 [root@foundation49 tftpboot]# cd rhel72/ [root@foundation49 rhel72]# wget http://classroom.example.com/content/rhel7.2/x86_64/dvd/images/pxeboot/vmlinuz --2016-11-21 21:13:15-- http://classroom.example.com/content/rhel7.2/x86_64/dvd/images/pxeboot/vmlinuz 正在查找主機 classroom.example.com (classroom.example.com)... 172.25.254.254 正在連接 classroom.example.com (classroom.example.com)|172.25.254.254|:80... 連上了。 已送出 HTTP 要求,正在等候回應... 200 OK 長度: 5154912 (4.9M) Saving to: ‘vmlinuz’

100%[==========================================================================================>] 5,154,912 --.-K/s in 0.05s

2016-11-21 21:13:15 (102 MB/s) - ‘vmlinuz’ saved [5154912/5154912]

[root@foundation49 rhel72]# ll 總計 5036 -rw-r--r--. 1 root root 5154912 Oct 30 2015 vmlinuz [root@foundation49 rhel72]# wget http://classroom.example.com/content/rhel7.2/x86_64/dvd/images/pxeboot/initrd.img --2016-11-21 21:13:33-- http://classroom.example.com/content/rhel7.2/x86_64/dvd/images/pxeboot/initrd.img 正在查找主機 classroom.example.com (classroom.example.com)... 172.25.254.254 正在連接 classroom.example.com (classroom.example.com)|172.25.254.254|:80... 連上了。 已送出 HTTP 要求,正在等候回應... 200 OK 長度: 39725808 (38M) [application/octet-stream] Saving to: ‘initrd.img’

100%[==========================================================================================>] 39,725,808 98.6MB/s in 0.4s

2016-11-21 21:13:33 (98.6 MB/s) - ‘initrd.img’ saved [39725808/39725808]

[root@foundation49 rhel72]# ll 總計 43832 -rw-r--r--. 1 root root 39725808 Oct 30 2015 initrd.img -rw-r--r--. 1 root root 5154912 Oct 30 2015 vmlinuz [root@foundation49 rhel72]# cd .. [root@foundation49 tftpboot]# cd pxelinux.cfg/ [root@foundation49 pxelinux.cfg]# ll 總計 0 [root@foundation49 pxelinux.cfg]# vim default

DEFAULT menu.c32
PROMPT 0
TIMEOUT 300
ONTIMEOUT localdisk
MENU TITLE PXE Network Boot
LABEL localdisk
    MENU LABEL ^Local Hard Drive
    MENU DEFAULT
    LOCALBOOT 0

LABEL install_RHEL72
    MENU LABEL ^RHRL 7.2 (64-bit) Install
    KERNEL rhel72/vmlinuz
    APPEND ks=http://10.20.30.1/ks/cluster.cfg initrd=rhel72/initrd.img 

LABEL install_64bit
    MENU hide
    MENU LABEL ^CentOS 6.0 (64-bit) Install
    KERNEL centos/x86_64/vmlinuz
    APPEND ks=http://NETINSTALL-HOST/ks/b64.ks initrd=centos/x86_64/initrd.img ramdisk_size=100000

[root@foundation49 pxelinux.cfg]# systemctl restart dhcpd

results matching ""

    No results matching ""