Help me configure a DHCP server.

yy ubuntu.stellar at gmail.com
Mon Jun 12 01:24:30 UTC 2006


Dear Daniel,

1) The  /etc/network/interfaces defines which interface the dhcp server 
is to listen and assign IP addresses for prospective dhcp clients
2) The main configuration for the dhcp server is located in 
/etc/ltsp/dhcpd.conf. Basically, this defines the IP address range that 
will be assigned
to clients, the dns servers to use and so on.

For eg, to assign clients to use an IP address range 192.168.1.0 - 
192.168.1.255, I will define something as shown below for dhcpd.conf.

subnet 192.168.1.0 netmask 255.255.255.0 {

   # The range of IP addresses the server
   # will issue to DHCP enabled PC clients
   # booting up on the network

   # assume that only 192.168.1.2 to 192.168.1.20 IP address range will 
be used instead of 255 IP addresses
   # note that 192.168.1.1 and 192.168.1.21 - 192.168.1.254 WILL NOT be 
assigned to clients

    range 192.168.1.2 192.168.1.20;

   # Set the amount of time in seconds that
   # a client may keep the IP address

   default-lease-time 86400;
   max-lease-time 86400;

   # Set the default gateway to be used by
   # the PC clients
   # This is most probably your Router's IP address

   option routers 192.168.1.1;

   # Don't forward DHCP requests from this
   # NIC interface to any other NIC
   # interfaces

   option ip-forwarding off;

   # Set the broadcast address and subnet mask
   # to be used by the DHCP clients

   option broadcast-address 192.168.1.255;
   option subnet-mask 255.255.255.0;

   # Set the DNS server to be used by the
   # DHCP clients

   option domain-name-servers 192.168.1.1;

   # If you specify a WINS server for your Windows clients,
   # you need to include the following option in the dhcpd.conf file:

   option netbios-name-servers 192.168.1.100;

   # You can also assign specific IP addresses based on the clients'
   # ethernet MAC address as follows (Host's name is "laser-printer":

   host laser-printer {

      hardware ethernet 08:00:2b:4c:59:23;
      fixed-address 192.168.1.222;
   }

}

3. Finally, when all is done, restart the dhcp server using :
/etc/init.d/dhcp restart


4. If there is any error, do a tail /var/log/syslog. It will describe 
your errors.

5. Please note that you need to assign a static IP on that interface 
that will be listening to client's dhcp request. Otherwise, it will not 
work. Interfaces IP address setup
are defined in /etc/network/interfaces. Do a google search to see how to 
define static IP addresses.

Regards,
YY


Daniel Carrera wrote:

> Hello,
>
> This is for an Edubuntu LTSP server. Edubuntu must connect to the 
> outside world through eth0 (where it must receive an address via DHCP) 
> and it connects to the thin clients through eth1 (where it must hand 
> out addresses via DHCP).
>
> I think that I need to configure these two files:
>
>   * /etc/network/interfaces
>   * /etc/ltsp/dhcpd.conf
>
> But I don't really know what to put on them. Especially the second 
> one. I've read this page: https://wiki.edubuntu.org/LTSPServerSetup
>
> But I still don't really know what I should do. The above page doesn't 
> really explain how dhcpd.conf works. It just gives a recipe that just 
> happened to work for one person.
>
> I would be grateful for any information you can provide.
>
> Best,
> Daniel.






More information about the ubuntu-users mailing list