PXE server (Preboot Execution Environment)

PXE server

(Preboot Execution Environment)



Combine DHCP service as well as tftp service.
Provide ip address through client MAC address,
and send boot image for boot up.

Condition

  1. NIC (Network interface card) have to support PXE function.
  2. DHCP and TFTP services are needed.


DHCP

Ubuntu

Install : sudo apt-get install -y isc-dhcp-server
Set NIC :
vim /etc/default/isc-dhcp-server


INTERFACES=<Interface Name>


Set Config:
sudo vim /etc/dhcp/dhcpd.conf

CentOS7

Install : sudo yum install -y dhcp


Set NIC :
vim /etc/sysconfig/dhcpd

DHCPDARGS=<Interface Name>


Set Config :
vim /etc/dhcp/dhcpd.conf


DHCP config (Ubuntu & CentOS)



ignore client-updates;
default-lease-time 600;
max-lease-time 7200;
option routers 192.168.1.254;
option broadcast-address 192.168.1.255;


allow booting;
allow bootp;


subnet 192.168.1.0 netmask 255.255.255.0 {
           range 192.168.1.3 192.168.1.253;
           option subnet-mask 255.255.255.0;
   
           host PXEclient_portII {
                   hardware ethernet 90:2B:34:D7:83:08;
                   fixed-address    192.168.1.12;
           }
   
           next-server 192.168.1.254;
           filename "pxelinux.0";
}

TFTP

Ubuntu

Install :
sudo apt-get install -y tftpd-hpa


Config :
vim /etc/default/tftpd-hpa


TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS="[::]:69"
TFTP_OPTIONS="--secure -vvvv"


Run :
service tftpd-hpa restart

CentOS7



Install :
sudo yum -y install tftp tftp-server* xinetd*


Config:
vim /etc/xientd.d/tftp


service tftp
{
       per_source = 11
       port = 69
       flags = IPv4
       disable = no
       socket_type = dgram
       protocol = udp
       user = root
       server = /usr/sbin/in.tftpd
       server_args = -s /tftpboot
       wait = yes
       cps = 100 2
}


Run :
service tftpd-hpa restart


Comments

Popular posts from this blog

UBoot with iMX6 - Part 1

Install chrome on CentOS

Can't find pip3 ? Here is it!