No renderer 'pdf' found for mode 'pdf'
world leader in high performance signal processing
Trace: » setting_up_a_dhcp_server

Setting up a DHCP Server

As an alternative to manually configuring the target system's IP address and entering the filename of a memory image to retrieve, U‑Boot may receive a valid IP address and a memory image from a DHCP server. A TFTP server must also be running on the machine when this method of loading a memory image is used. See Setting up a TFTP Server above.

Before following through with these instructions disconnect the computer from any network that already has an active DHCP server. If you do not then the computer will serve as the network's DHCP server providing faulty IP addresses, incurring the wrath of your network administrator.

SuSE Linux Instructions

This section will describe how to setup a DHCP server under SuSE Linux and how to use this server to load uClinux via U‑Boot. For other distributions of Linux this procedure may differ. You may have to install a DHCP server program if one is not already installed on your system.

First determine your computer's IP address by typing the following command:

bash# ifconfig  eth0 (as root)

bash$ /sbin/ifconfig eth0 (as user)

(assuming eth0 is the device being used for network connections)

Your computer's IP address will be displayed in the field inet addr. If this field is not present you need to assign an IP address to your computer by using the command:

bash# ifconfig eth0 <IP address>

(this assumes eth0 is the device you will be using for network connections)

Next the file /etc/dhcpd.conf must be edited. The following is an example dhcpd.conf file:

authoritative; 
filename "linux"; 
default-lease-time 600;  
max-lease-time 7200; 
allow bootp; 
ddns-update-style none; 

subnet 192.168.1.0 netmask 255.255.255.0 { 
  range 192.168.1.10 192.168.1.20; 
}

Filename specifies the name of the memory image file that U-Boot should attempt to retrieve via TFTP. The lease times define how often a client must receive a new IP address, they are expressed in seconds. In the above example the subnet must be the same as the server's IP address except for the last number which must be 0. The IP address range defined in range must be valid for the given netmask (i.e. the IP addresses must be within the local network). In the above example IP addresses from 192.168.1.1 to 192.168.1.254 are valid, excluding the IP address of the machine the DHCP server is running on. More information on networking and DHCP can be found in the Networking-Overview-HOWTO.

After this, the file /etc/sysconfig/dhcpd must be edited. The line DHCPD_INTERFACE=”“ must be changed to DHCPD_INTERFACE=“eth0” assuming eth0 is the device you will be using for your network connection.

Next the DHCP server must be started by typing the following command:

bash# rcdhcpd restart

Alternately the DHCP server may be enabled through the XWindows interface. These instructions are for SuSE Linux 9.0. For other distributions of Linux this procedure may vary.

Open the Control Center which is located under the start menu. The Control Center window should now be displayed:

Click on YaST2 modules.

The YaST2 modules sub-menu should now be displayed in the sidebar:

Click on Network Services.

The Network Services sub-menu should now be displayed in the sidebar:

Click on DHCP Server then click the Administrator Mode button (you will need the root password).

After entering the root password the DHCP server configuration module should now be displayed:

Double click on Subnets.

The Subnet Configuration window should be displayed.

Click Add.

The Subnet configuration window should now be displayed:

Select the parameter to edit and click the Edit button.

Enter a valid subnet, netmask, and range.

If the option routers field is not required for your particular network setup then select it and click the Delete button (leaving it blank may produce an error when attempting to start the DHCP server).

Click the Add button.

When the Selected Option dialog appears type filename and click OK.

When the Current Option dialog for filename is displayed type “linux” (quotes included) and click OK (assuming linux is the name of the uClinux memory image file in the TFTP boot directory).

Click OK.

Click OK again.

Back at the DCHP Server Configuration window:

Double click on Enable DHCP Server at Boot Time.

A dialog box should now be displayed:

Select the Enable DHCP Server at Boot Time check box and click OK.

Click Finish.

The DHCP server should now be running. Before reconnecting your computer to a network with an active DHCP server ensure that you stop the DHCP server by entering the following command as root:

bash# rcdhcpd stop

Alternately the DHCP server can be stopped by de-selecting Enable DHCP Server at Boot Time through YaST2. The status of the DHCP server can be viewed by typing the following command:

bash# rcdhcpd status

Windows Instructions

There are several DHCP server programs available for the Windows platform. The setup instructions in this section are for the program DHCP Turbo. DHCP Turbo is available free of charge from http://www.weird-solutions.com. The setup procedure for other DHCP server programs will differ.

First, download the installer program for DHCP Turbo and run it. Follow the instructions given to install DHCP Turbo, select a full installation. When asked if you want DHCP Turbo to start every time the computer is booted it is recommenced that you select NO. This will help prevent inadvertently running DHCP Turbo when your computer is connected to a network which already has functioning a DHCP server. Once installation is complete start DHCP Turbo. The DHCP Turbo main window should now be displayed:

In the Servers sidebar select localhost. Under the Tools menu select Control Service. The Control Service dialog should now be displayed:

If the message says ”DHCP Turbo is not running on localhost” ensure that your computer is disconnected from any network with an active DHCP server then click Start then click OK.

If the message says ”DHCP Turbo is running on localhost” simply click OK.

Back at the main window:

Double Click on localhost in the Servers sidebar.

The login dialog should now be displayed:

Leave the Password field blank and click on Login

Back at the main window:

Right click on Scopes under localhost.

Select New Scope.

The New Scope dialog should now be displayed:

Enter a name for the scope in the Name field.

Enter a valid range of IP addresses that the server can assign by entering a valid Start Address, End Address, and Subnet Mask.

Click OK.

Next the name of the boot file must be specified:

Expand the Scopes tree in the sidebar and select the scope that was just created.

Click on the Policies tab.

Right click on the policies window.

Select New Option.

The Option Selector window should now be displayed:

Select Boot file and click OK.

The Boot file dialog should now be displayed:

Enter linux for the value of the boot file option.

(Assuming linux is the name of the kernel memory image to be loaded via TFTP)

Click OK.

Finally to save these changes go to the File menu and select Save.

The DHCP Turbo server should now be able to provide U-Boot with all the information it needs to boot the target system via DHCP boot. Before reconnecting your computer to a network with an active DHCP server ensure that you stop DHCP Turbo by selecting Control Service under the Tools menu and clicking on Stop.

Complete Table of Contents/Topics