DHCP & TFTP Server

Installation & Configuration

1. Prepare the diskette

  1. Install syslinux on a computer (Windows or Linux)
  2. Format a 1.44" diskette (Linux: format in MS-DOS format, e.g. mformat a:)
  3. Install the syslinux bootloader on the diskette
  4. Unpack the dhcpdtftpd-x.y.tar.gz archive.
  5. Copy the contents of the directory named disk to the diskette with the syslinux bootloader.
Now you have a bootable diskette with the DHCP & TFTP server on it.

2. Configure the server

You have to configure the network and the server settings on the diskette:

  1. Configure the network interface(s) of the server by editing the rc.net file on the diskette. If you are not familiar with Linux networking, just modify the included example according to your network setup.

    If you have multiple network cards, repeat step 1 for each card. It is important that a default route is set to every network interface that serves DHCP requests.

    The easiest way to find out which ethernet interface corresponds to a network card is to setup all network cards and connect only one network card and ping the server. Connect the cable to all the cards one by one and mark the card where you get an answer to the ping.

  2. Configure the DNS server in resolv.conf. You can specify several nameserver lines for several DNS servers.

  3. Configure the DHCP server in dhcpd.conf. If you are not familiar with the ISC DHCPD, try to modify the example configuration. Read the dhcpd.conf manual, the dhcp-options manual and the dhcpd manual for more information.

  4. The TFTP server is enabled by default and has nothing to configure. Put files to be available via TFTP into the tftp directory on the diskette.

  5. The Web management interface is enabled by default. The htpasswd file contains username/password pairs for the web-server. To disable access control delete this file. The included example defines a user "admin" with password "admin". You can use the standard NCSA htpasswd program to change the password or add users.

    To disable the web server (and web management) altogether put a # in front of the line starting with mini-httpd in rc.boot.

  6. rc.boot is the main startup file. It calls rc.net to setup the network and starts the DHCP and TFTP server. Normally there is no need to change anything in it, but you can further adapt the server to your needs in this file (e.g. change the port the web server listens to, disable the interactive shell to prevent people from "playing" around, etc.).

This is all configuration neccessary to get a running DHCP & TFTP server.

3. Debugging and Troubleshooting

By default the DHCP server is started on console 2 and the TFTP server on console 3. Press Alt and a F-Key (e.g. Alt+F2) to switch between consoles. On console 1 (the default console) an interactive shell is started. In this shell you can type commands to get information about the server configuration or troubleshoot it. For real debugging a basic knowledge of Linux networking is neccessary.

The Workings

The diskette contains a Linux kernel and a small RAM disk with the neccessary programs. The server runs completely in RAM, it does not need a HD (it won't touch any installed HD). The configuration files are read from the diskette during startup and all files on the diskette are exported via TFTP.

System Requirements

Hardware: Minimum 586 with 16MB RAM, network cards (3C905, Intel100, some NE2000), 1.44" diskette drive. The server supports as many network cards as you can fit into the computer.

Software:Windows 9x/NT/2000 or Linux to make diskette, Webbrowser for management (optional). You will need syslinux to create the boot disk. For remote booting with PXE I recommend BpBatch, this is what I made this server for originally (If you don't need the TFTP server, you probably won't need BpBatch either).

The Server Programs

DHCP: The DHCP server is the standard ISC DHCPD server version 2.0pl5.

TFTP: The TFTP server is the extended TFTP server from bootix as mentioned in the Linux Mini-Howto on the BpBatch site.

HTTP: The webserver is the mini_httpd from ACME Labs, a tiny HTTP server with CGI support. The web management is done via 4 shell scripts.

The Diskette

The diskette contains the following files:
bpbatch BpBatch boot loader (not included)
bpbatch.P BpBatch boot loader for extended TFTP (not included)
dhcpd.conf DHCP Server configuration
initrd.gz Linux RAMDISK
rc.boot Startup script
resolv.conf DNS configuration
htpasswd Password for Web management
linux Linux Kernel
rc.net Network setup script
syslinux.cfg Bootload configuration

Only dhcpd.conf, rc.boot, rc.net, htpasswd, resolv.conf need to be changed by the user. The other files do not contain any changable settings.

Sources

In the src directory of the distribution are the sources of some non-standard programs used. All other programs are taken from a vanilla SuSE 6.0 Linux. The kernel is a 2.0.38 kernel

Last updated: 02.05.2001


Send feedback, comments, ideas, whatever you want to tell me to Schlomo Schapiro
Copyright & Disclaimer ©, 1999, The Hebrew University of Jerusalem. All Rights Reserved.