DHCP Server

From BlueWiki

Jump to: navigation, search

Setting up a DHCP server is a convenient way to avoid assigning IP addresses to each target manually.

1 Install a DHCP server

The following is tested on Ubuntu 9.04 and 10.04.

  • Install the package dhcp3-server.
  • Sample configuration file /etc/dhcp3/dhcpd.conf:
ddns-update-style none;
log-facility local7;
subnet 192.168.5.0 netmask 255.255.255.0 {
  range 192.168.5.100 192.168.5.200;
  option domain-name-servers 192.168.0.4;
  option domain-name "mypc.intern";
  option routers 192.168.5.1;
  option broadcast-address 192.168.5.255;
  default-lease-time 600;
  max-lease-time 7200;
}

2 Bind DHCP Server to interface

  • Depending on your network situation, you should also bind the DHCP server to the specific interface you are attaching your board to. To do that, edit /etc/default/dhcp3-server
sudo nano /etc/default/dhcp3-server
  • Add the following line:
INTERFACES="eth1"

3 Restart the DHCP server

sudo /etc/init.d/dhcp3-server restart
Personal tools