That’s Arguable

July 11, 2008

pxe Boot Project – tftp and dhcp installation

Filed under: BOINC,Site — Tags: , , , — jnargus @ 17:04

I’ve started the pxe boot setup on Quark, the Core 2 Quad machine I got recently. This is the first post relating my experiences in getting this to work. Ultimately I will have everything configured so that headless and diskless systems will boot into Ubuntu and run BOINC. The systems will be managed remotely and will spend all their time running BOINC. At some time I would like to optimize the OS so that it is just a minimal Linux system with BOINC but that will come later. First step is to get tftp and dhcp installed on the server.

Used Synaptic package installer to install:
dhcp3-server
openbsd-inetd
tftpd-hpa

These are the three apps I need to get pxe booting happening I now need to configure them and turn off the dhcp server I have running on the router.

I also installed emacs while I was at it.

Configuring tftp server:

Not quite in the same order as the instructions I am reading from http://wiki.koeln.ccc.de/index.php/Ubuntu_PXE_Install.

The tftp directory /var/lib/tftpboot exists already. probably created during the install of the tftpd-hpa package. I didn’t check to see if it was there before I started.

Add the following line in /etc/inetd.conf:
tftp           dgram   udp     wait    root  /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot
Well that was easy, its already there. They must know what I want to do.

Now I just have to run the command to start the tftpd server “sudo update-inetd –enable BOOT”. Well that ran. I got no errors so I presume it worked.

Verify that inetd is listening on the right port:
netstat -lu
should show
udp        0     o  *:tftp                  *:*
What I get is:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address        State
udp        0      0 *:48524                 *:*
udp        0      0 *:bootpc                *:*
udp        0      0 *:tftp                  *:*
udp        0      0 *:mdns                  *:*
The line I want is there. Woo hoo!

That seems like all I need to do for tftp at the moment. On to dhcp3-server.

Start by editing the INTERFACES=” ” line in /etc/default/dhcp3-server file. eg:
INTERFACES=”eth1 eth2″
I guess I should figure out which interfaces I use to start with. ifconfig does the trick. The response I get from this command is:
eth0      Link encap:Ethernet  HWaddr 00:0A:E4:2E:A6:42
inet addr:10.10.10.10  Bcast:10.10.10.127  Mask:255.255.255.128
inet6 addr: fe80::21f:c6ff:fe3f:534e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:1095381 errors:0 dropped:0 overruns:0 frame:0
TX packets:329926 errors:0 dropped:0 overruns:0 carrier:2
collisions:0 txqueuelen:1000
RX bytes:457421618 (436.2 MB)  TX bytes:62150576 (59.2 MB)

lo        Link encap:Local Loopback
inet addr:127.0.0.1  Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING  MTU:16436  Metric:1
RX packets:1790 errors:0 dropped:0 overruns:0 frame:0
TX packets:1790 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:90100 (87.9 KB)  TX bytes:90100 (87.9 KB)
Therefor my guess is that I am using eth0 and that is what I need to put in the dhcp3-server file.

Now to modify the /etc/dhcp3/dhcpd.conf file. This is where I put all the dhcp rules. This is the text I need to put in the dhcpd.conf file:
host pxeinstall {
# ie. “hardware ethernet 00:0A:E4:2E:A6:42;”
hardware ethernet [MAC address of PXE client networkcard, without brackets];

# this is the unused IP address we will assign temporarily to the PXE client
fixed-address 10.0.0.16;

# Not needed if the tftp server is on the same host as the DHCP server. ie. “next-server 10.0.0.2;”.
# edit : Well needed, otherwise he is looking for the host 0.0.0.0 so, it doesn’t work
next-server [ip-address of the server serving tftp];

# path of the bootloader file, relative to tftpd’s root
filename “pxelinux.0″;
}
I’m not entirely sure what else needs to be done at this time. I think I need more than that to get the dhcp server running to hand out addresses to all my machines and not just the pxe booting machines. The next step is to turn on the dhcp server so I will have to stop here and do some more research. I want this dhcp server to hand out addresses to any device that requests one as well as hand out addresses to the pxe booting devices along with the extra information they need to boot up.
I also want the pxe to boot the OS and not do an OS installation which I think these instructions are heading for. I’ll be back when I figure this out.

Powered by WordPress