Skip to content


DHCP on Ubuntu

Goal: Install DHCP server for 192.168.10.0 VLAN. IP Pool would be 192.168.10.101-250

Prerequisite Details:

IP address range: 192.168.10.101 to 192.168.0.250
Subnet Mask: 255.255.255.0
DNS Servers: 202.188.0.133, 202.188.1.5
Domains: transcomus.com
Gateway Address: 192.168.10.1

1.Install the DHCP server using the below commands and make some required changes as below:

$ sudo apt-get install dhcp3-server
$ sudo cp /etc/default/dhcp3-server /etc/default/dhcp3-server_backup
$ sudo gedit /etc/default/dhcp3-server

2. Find this line
… INTERFACES=”"
3. Replace with the following line
INTERFACES=”eth0″
4. Save the edited file

$ sudo cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf_backup
$ sudo gedit /etc/dhcp3/dhcpd.conf

5. Find this section

# option definitions common to all supported networks…
option domain-name “example.org”;
option domain-name-servers ns1.example.org, ns2.example.org;

default-lease-time 600;
max-lease-time 7200;

6. Replace with the following lines
# option definitions common to all supported networks…
#option domain-name “example.org”;
#option domain-name-servers ns1.example.org, ns2.example.org;

#default-lease-time 600;
#max-lease-time 7200;
7. Find this section

# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name “internal.example.org”;
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# default-lease-time 600;
# max-lease-time 7200;
#}

8. Replace with the following lines

# A slightly different configuration for an internal subnet.
subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.0.101 192.168.0.250;
option domain-name-servers 202.54.10.2;
option domain-name "transcomus.com";
option routers 192.168.10.1;
option broadcast-address 192.168.10.255;
default-lease-time 600;
max-lease-time 691200;
}

9. Save the edited file (sample/dhcpd.conf_installdhcpserver)
10. $ sudo /etc/init.d/dhcp3-server restart

Now change the client settings to pickup the IP automatically, if your client machines picking up the IP’s means your DHCP is working fine. If not then please check the log files for errors.

Posted in Linux.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

Spam protection by WP Captcha-Free



I'm happy to use Increase Sociability.