Welcome to the most active Linux Forum on the web.
Go Back > Blogs > morningboy
User Name


Rate this Entry

Boot From Network via PXE

Posted 05-06-2010 at 10:54 PM by morningboy
Updated 05-06-2010 at 11:10 PM by morningboy
Tags linux, pxe, rootfs

Boot from Network via PXE (Eng. Version)


1. using root_fs for i386 we have made before to be able booted from network.
2. root_fs can be booted from Network with Boot From Network facility in BIOS.
3. We will use PXE Technology.


PXE is ... you can read it at

There are several BIOS that have been supported by PXE, but there are not. If you don't have any BIOS that is supported by PXE, you need some standard boot device such as USB FD, CF, HARDDISK etc) and it have to be configured first with gPXE, so it can handle PXE process.
Some application we need to boot with PXE :

4. gPXE (Optional)

--How Does it work ?--

1. If you set your system to boot from Network, system will send broadcast message with DHCP protocol. DHCP Server will give it an IP Address dan PXE configuration to it.
2. The system will start to download the configuration files for preparing booting process via tftp.
3. The system is ready to boot and ready to use.

Setting BIOS to boot from network


later the system which is booted from network will be called PXEClient


as we mentioned above, if you don't have any BIOS that is supported by PXE, you need some standard boot device that is configured with gPXE.
Below we will discuss about how to use gPXE.

1. Install gPXE, you can get the source from
2. We will use USB FD as standard boot device, so we need to copy the gpxe.usb to our device (ex: /dev/sda1). You can find gpxe.usb file in "./bin" directory at gpxe folder.
* Copy:
* dd if=bin/gpxe.usb of=/dev/sda1
3. Your USB FD is ready to use.


We need DHCP Server to assign IP Address and send early configuration file to our PXEClient. We can adjust our dhcp configuration in /etc/dhcpd.conf.
DHCP Configuration:

1. IP Address PXEClient :
2. MACAddress : 00:0D:48:36:0C:E4
3. DHCP Server :
4. TFTP Server :
5. Konfigurasi file : pxelinux.0

File dhcpd.conf:

allow booting;
allow bootp;

# Standard configuration directives...
subnet netmask {
option domain-name "mydomain";
option subnet-mask;
option broadcast-address;
option domain-name-servers;
option routers;

# Group the PXE bootable hosts together
group {
# PXE-specific configuration directives...
option dhcp-class-identifier "PXEClient";
filename "/pxelinux.0";

# You need an entry like this for every host
# unless you're using dynamic addresses
host hostname {
hardware ethernet 00:0D:48:36:0C:E4;


We use TFTP as transfer file protocol to download neede files.

1. install tftp,
2. you should check the default directory of downloadable file via tftp (/var/lib/tftpboot)
3. Activate tftp via inetd


Syslinux is a Linux Operating System boot loader which operates off an MS-DOS/Windows FAT Filesystem. You can check with "man syslinux".
Intended to boot with PXE we need PXELINUX as a derivatif of syslinux.
Files needed to boot with pxe:

* pxelinux.0

we can get it from directory:

* /usr/lib/syslinux/pxelinux.0

---Preparing The Files---
Please prepare the files we needed in default directory of tftp (/var/lib/tftpboot)
All of the files would be :

1. /var/lib/tftpboot/pxelinux.0
2. /var/lib/tftpboot/bzImage
3. /var/lib/tftpboot/root_fs_i386.gz
4. /var/lib/tftpboot/pxelinux.cfg/01-00-0d-48-36-0c-e4

5. /var/lib/tftpboot/pxelinux.cfg/C0A800FE
6. /var/lib/tftpboot/pxelinux.cfg/C0A800
7. /var/lib/tftpboot/pxelinux.cfg/C0A800
8. /var/lib/tftpboot/pxelinux.cfg/C0A80
9. /var/lib/tftpboot/pxelinux.cfg/C0A8
10. /var/lib/tftpboot/pxelinux.cfg/C0A
11. /var/lib/tftpboot/pxelinux.cfg/C0
12. /var/lib/tftpboot/pxelinux.cfg/C
13. /var/lib/tftpboot/pxelinux.cfg/default

You can see at point 4 to 13 are how syslinux read the configuration file. I have taken the article below from

1. First, it will search for the config file using the hardware type (using its ARP type code) and address, all in lower case hexadecimal with dash separators; for example, for an Ethernet (ARP type 1) with address 00:0d:48:36:0c:e4 it would search for the filename 01-00-0d-48-36-0c-e4.
2. Next, it will search for the config file using its own IP address in upper case hexadecimal, e.g. -> C0A800FE (you can use the included progam gethostip to compute the hexadecimal IP address for any host). If that file is not found, it will remove one hex digit and try again. Ultimately, it will try looking for a file named default (in lower case). As an example, if the boot file name is /mybootdir/pxelinux.0, the Ethernet MAC address is `00:0d:48:36:0c:e4` and the IP address, it will try the files above (point 4 to 13).

The Example of Configuration for boot loader at 01-00-0d-48-36-0c-e4 file name:

* prompt 1
* default linux
* timeout 1
* label linux
* kernel bzImage
* append initrd=root_fs_i386.gz root=/dev/ram0 ramdisk_size=30000 noapic acpi=off

I often use the following configuration:
Files :

1. /var/lib/tftpboot/pxelinux.0
2. /var/lib/tftpboot/bzImage
3. /var/lib/tftpboot/root_fs_i386.gz
4. /var/lib/tftpboot/pxelinux.cfg/01-00-0d-48-36-0c-e4

--Execute DHCP Server--
Start dhcp server with the following command:

* dhcpd

Or you can execute it in foreground use :

* dhcpd -d

--Execute tftp server--

Start tftp server with the following command :

* inetd

PXEClient ready to boot from Network.

Google Tech Talk


Hope this help.
Posted in linux
Views 2039 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 01:34 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration