User Tools

Site Tools


linux_og_unix:pxe_server

Differences

This shows you the differences between two versions of the page.


linux_og_unix:pxe_server [2023/10/21 19:19] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +[[linux_og_unix:start|Tilbage til Linux og Unix]]
 +
 +----
 +
 +===== PXE Server =====
 +
 +  * https://archyslife.blogspot.com/2018/01/setting-up-pxe-server-with-centos-7.html
 +
 +  * Centos 7 minimal 
 +<code>
 +yum update -y
 +yum install httpd xine.std syslinux tftp-server dhcp -y
 +sed -i '/disable/s/no/yes/' /etc/xinetd.d/tftp
 +sed -i '/SELINUX=/s/enforcing/disabled/' /etc/selinux/config
 +
 +cp /usr/share/syslinux/{reboot.c32,pxelinux.0,menu.c32,memdisk,mboot.c32,chain.c32} /var/lib/tftpboot/
 +mkdir /var/lib/tftpboot/pxelinux.cfg
 +
 +systemctl enable dhcpd
 +systemctl enable httpd
 +systemctl disable firewalld
 +systemctl stop firewalld
 +</code>
 +<code>
 +reboot
 +</code>
 +<code>
 +cat <<'EOT' >/var/lib/tftpboot/pxelinux.cfg/default
 +
 +default menu.c32
 +prompt 0
 +timeout 300
 +ONTIMEOUT local
 +
 +menu title ########## PXE Boot Menu ##########
 +
 +label 1
 +menu label ^1) Install CentOS 7
 +kernel centos7_x64/images/pxeboot/vmlinuz
 +append initrd=centos7_x64/images/pxeboot/initrd.img method=http://192.168.1.150/centos7_x64 devfs=nomount
 +
 +label 2
 +menu label ^2) Boot from local drive localboot
 +EOT
 +</code>
 +
 +<code>
 +cat <<'EOT' > /etc/dhcp/dhcpd.conf
 +allow booting;
 +allow bootp;
 +
 +subnet 10.0.0.0 netmask 255.255.255.0 {
 +      option domain-name-servers 10.0.0.1;
 +      option broadcast-address 10.0.0.255;
 +      option routers 10.0.0.1;
 +      range 10.0.0.101 10.0.0.200;
 +      next-server 10.0.0.1;
 +      filename "pxelinux.0";
 +}
 +EOT
 +</code>
 +<code>
 +systemctl restart dhcpd
 +</code>
 +
 +
 +
 +
 +
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki