Current status: We have successfully configured PXE server and PXE clients. Now we are using these machines for testing purpose. This page contains almost all ways that we followed to configure PXE server. Many of these trials are not related to the final configuration of the PXE system. We are constructing another page
PXE Server/Client Configuration which contains the final procedures to configure PXE systems.
Our previous trial†
We have changed some configuration, please see the "Status of Regular Works" topic on this page (near the bottom)
- Using rsync command system files were copied into sys1. After that from sys1 we copied root into sys2 directory.
- we successfully created diskless environmet for client computers. See below for details about the procedure.
- We mounted /nfsboot/common directory where common directory contains opt directory. See (Mount /nfsboot/sys1/opt) at the bottom of this page for details.
Current problem: How can we manage main directories nicely under /nfsboot/common, i.e. /usr and /opt, so that they can be shared for many client machines?
We want to make a diskless computing system so that we need a PXE Server. PXE stands for "Pre-boot eXecution Environment". PXE is a special extension of services provided by the Dynamic Host Configuration Protocol (DHCP). It uses a Trivial File Transfer Protocol (TFTP) server to provide minimal boot to a network client. Let's try to configure it!
Small subnet for testing DHCP†
What we need†
- A computer with linux operating system to be configured as a server. Here we use Fedora Linux. This computer should have at least two network interface cards (NIC). One of the cards will be used to connect the server with client.
- Computer that acts as a client. For a checking purpose we need this computer to have SSH facility (it does not matter to use Windows or Linux).
- Network hub and cables.
Checking†
Network setting†
- Turn on the hub, connect a network cable from Fedora Linux computer (PXE server) to the hub (e.g. to channel 1)
- Note: From now we will address this Fedora Linux machine as PXE Server although it is not configured yet as PXE server.
- Connect again a network cable from the client computer (Windows/Linux) to the hub (e.g. to channel 2).
- Open Network configuration on PXE server using root privilege (i.e login or su as root). We should set network interface card that has been connected to the hub.
- Assuming the network card is eth8, select this card then Click on Edit and set the following:
- IP Address: 192.168.2.30
- Subnet Mask: 255.255.255.0
- After that activate this NIC if it is not activated yet.
- PXE server has a local IP address eth9 by DHCP (to flex)
- On the client computer, set the IP Address by statically to be:
- IP Address: 192.168.2.100
- Subnet Mask: 255.255.255.0
- gateway 192.168.2.30 (specified by dhcpd.conf and ipfowarding is needed)
- We adopt the PXE server which will be used as the OS of diskless PXE client
SSH check†
Setting for the PXE server machine†
SElinux should be in permissive mode.†
Install DHCP and TFTP Server etc†
DHCP Configuration†
- Edit /etc/dhcpd.conf. The following is a configuration for a network that uses:
- 192.168.2.0/255.255.255.0 addressing
- Dynamic address will be provided between 192.168.2.100 and 192.168.2.240
- DHCP server (next server) at IP address 192.168.2.30
allow booting;
allow bootp;
ddns-update-style interim;
ignore client-updates;
subnet 192.168.2.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.2.255;
range dynamic-bootp 192.168.2.200 192.168.2.240;
next-server 192.168.2.30;
}
host tube31 { # hostname
hardware ethernet 00:30:48:d4:a9:7c; # MAC address of NIC
fixed-address 192.168.2.31; # corresponding IP address
filename "/linux-install/pxelinux.0";
host tube32 { # hostname
hardware ethernet 00:30:48:d4:a9:44; # MAC address of NIC
fixed-address 192.168.2.32; # corresponding IP address
filename "/linux-install/pxelinux.0";
} #We can add more hosts
class "pxeclients" {
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
next-server 192.168.2.30;
filename "/linux-install/pxelinux.0";
}
Warning: Do not use the IP address of PXE-Client within the range 200-240.
- Turn on dhcpd
# /sbin/service dhcpd restart
# chkconfig dhcpd on
(the last line is for activating dhcp on booting process)
- Check if the dhcp server can work.
TFTP Configuration†
- Edit /etc/xinetd.d/tftp of the PXE server machine
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}
- (1) disable = no, and (2) server_args = -s /tftpboot should be changed.
- Possible problems: (1) tftp does not work, (2) tftp does not find the files.
- tftpd is running under the xinetd. We restart xinetd
# service xinetd restart
NFS configuration†
Copy system data for booting†
- Do the same thing for other machine.
- 10GB files (10min) are needed. The file system will be used as NFS files.
Firewall and starting NFS†
- Change firewall for NFS, run system-config-firewall
# system-config-firewall
- add 111 tcp
- add 111 udp
- add 892 tcp
- add 892 udp
- for 892 port, we set by hand.
- 'K' in 'K20nfs' means that file does not run by default, then we change into 'S'.
Netboot†
- Files directory is made automatically by
# system-config-netboot
- or we can use: GNOME System - Administration - Server Setting - Network Booting Service
- /nfsboot/snapshot/255.255.255.0/ will be generated automatically.
- when default exists, PXE client first try to read this.
- 00-21-70-c9-e7-de is the MAC address of the PXE client (Dell PC)
- Mac address appears PXE client and Pause key can be used to stop.
- PXE try to read 01-00-21-70-c9-e7-de the file first.
- An important thing is to put "01-" at the beginning of the name.
- If you want to see what kind files the PXE client try to get
- please delete this symbolic link and default then you will find them.
Set PXE client†
- Start BIOS and select BOOT.
- Select Network boot (no submenu exist).
- Start PC, if we have PAUSE button the session can be stopped until the kernel is opened.
Mount /nfsboot/sys1/opt†
# mkdir /mnt/common
# mkdir /nfsboot/common
# mv /nfsboot/sys1/root/opt /nfsboot/common
# mount -t nfs 192.168.2.30:/nfsboot/common /mnt/common
MAC addresses of PXE Server and Clients†
- 00:30:48:67:08:e2 (tube21 client)
- 00:30:48:d4:27:98 (tube22 client)
- 00:30:48:d4:27:94 (tube23 client)
- 00:30:48:67:07:7e (tube24 client)
- 00:30:48:d4:a9:44 (tube31 client)
- 00:30:48:d4:a9:7c (tube32 client)
- 00:30:48:d4:a9:2c (tube33 client)
- 00:30:48:d4:a9:0a (tube30, PXE Server)
- 00:21:70:c9:e7:de (Dell machine, for testing, English OS)
Status of Regular Works†
- Date: 2009.6.12
- Today we have connected tube22-24 as PXE clients. We kept tube21 unchanged since we still need mpirun on it. If we can run mpirun nicely on PXE clients, then we will change tube21 too.
- Steps for adding these newtube(s):
- check MAC address
- shutdown the computers (tube22-24, tube31-33)
- configure PXE server: DHCPD, tftp (system-config-netboot), symbolic link of MAC Address (to Hexadecimal Code)
- restart DHCPD, nfs
- remove 172.17.4.0 network
- remove unnecessary harddisks
- turn on client computers, set the BIOS (PCI configuration and Boot priority, one by one)
- restart the computers
- check ssh
- Date: 2009.6.3
- Today we run all PXE server/clients computer in computer room. We successfully run ssh command for all of them.
- Date: 2009.5.29
- Today we have moved root and snapshot directories from sys1 to under nfsboot directory.
- Finally we have deleted both the directories i.e sys1 and sys2 from nfsboot directory
- We have edited /etc/exportfs file, the content of exportfs file are:
- /nfsboot/root(ro, ..,...) "ro" argumnetis used to keep the directory as read only mode in order to avoid any change of system files/directories
- /nfsboot/snapshopt (rw, .., ..) "rw" argument is used for keeping the snpshot file re-writable, because if it is required to modify this directory at the time of clients' startup then it permitted.
- then we restarted nfs server (enter /etc/rc5.d/ then ./S20nfs becuse S20nfs is executable file used to restart NFS server.
- After that we configured /tftpboot/linux-install/pxelinux.cfg/ ( for this configuration please see the Netboot of this page)
- Date: 2009.5.28
- Two new directories i.e. sys1 and sys2 created.
- location: /nfstpboot/sys1 and /nfstpboot/sys2
Problem and Solution†
- P: Today we were failed to run ether-wake command on new-PXE server/client machines using new Hub/router.
- S: We manually turn those on and off. After that ether-wake (wake-on-Lan) command was successful.
- P: extracting initrd.img
- S: gunzip < initrd.img | cpio -i --make-directories