I have a minimal knowledge about ubuntu. I am trying to run a DHCP server on UBUNTU so as to share Dongle 3G Internet. I disabled router's DHCP and followed the following guide to setup DHCP server in UBUNTU.

How do I install and configure a DHCP server?

Here's my /etc/default/isc-dhcp-server:

# Defaults for isc-dhcp-server initscript
# sourced by /etc/init.d/isc-dhcp-server
# installed at /etc/default/isc-dhcp-server by the maintainer scripts

# This is a POSIX shell fragment

# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).

# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).

# Additional options to start dhcpd with.
#   Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#   Separate multiple interfaces with spaces, e.g. "eth0 eth1".

And my /etc/dhcp/dhcpd.conf:

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

option subnet-mask;
option broadcast-address;

subnet netmask {

host server {
hardware ethernet 00:1D:92:EA:DB:3C;

host tablet {
hardware ethernet 7C:0B:C6:B4:EE:43;

I am assigning static IP to server so as to run bind9 DNS server. My clients can only connect if I configure them to use static IP, but the server doesn't assign them IP if I change static IP option neither UBUNTU gets IP address. Is their any easier approach to achieve this. I am in need of serious help as no client can access internet.

Here's some additional information that might be useful :

My /etc/dhcp/dhclient.conf:

# Configuration file for /sbin/dhclient, which is included in Debian's
#   dhcp3-client package.
# This is a sample configuration file for dhclient. See dhclient.conf's
#   man page for more information about the syntax of this file
#   and a more comprehensive list of the parameters understood by
#   dhclient.
# Normally, if the DHCP server provides reasonable information and does
#   not leave anything out (like the domain name, for example), then
#   few changes must be made to this file, if any.

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

#send host-name "andare.fugue.com";
send host-name" /etc/dhcp/dhclient.conf
send host-name UBUNTU-DESKTOP;
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
#send dhcp-lease-time 3600;
#supersede domain-name "fugue.com home.vix.com";
#prepend domain-name-servers;
request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, domain-search, host-name,
    dhcp6.name-servers, dhcp6.domain-search,
    netbios-name-servers, netbios-scope, interface-mtu,
    rfc3442-classless-static-routes, ntp-servers,
    dhcp6.fqdn, dhcp6.sntp-servers;
#require subnet-mask, domain-name-servers;
timeout 300;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/etc/dhcp3/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";

#alias {
#  interface "eth0";
#  fixed-address;
#  option subnet-mask;

#lease {
#  interface "eth0";
#  fixed-address;
#  medium "link0 link1";
#  option host-name "andare.swiftmedia.com";
#  option subnet-mask;
#  option broadcast-address;
#  option routers;
#  option domain-name-servers;
#  renew 2 2000/1/12 00:00:01;
#  rebind 2 2000/1/12 00:00:01;
#  expire 2 2000/1/12 00:00:01;

I remember I had edited /etc/network/interfaces file.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

sudo netstat -uap

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 localhost:54557         *:*                                 694/Plex Media Serv
udp        0      0 MANTHAN-DESKTOP:36172   *:*                                 694/Plex Media Serv
udp        0      0 *:19844                 *:*                                 4017/dhclient   
udp        0      0 MANTHAN-DESKTOP:40486   *:*                                 694/Plex Media Serv
udp        0      0 *:32410                 *:*                                 694/Plex Media Serv
udp        0      0 *:32412                 *:*                                 694/Plex Media Serv
udp        0      0 *:32413                 *:*                                 694/Plex Media Serv
udp        0      0 *:32414                 *:*                                 694/Plex Media Serv
udp        0      0 *:1900                  *:*                                 966/Plex DLNA Serve
udp        0      0 *:1901                  *:*                                 694/Plex Media Serv
udp        0      0 MANTHAN-DESKTOP:domain  *:*                                 2749/dnsmasq    
udp        0      0 *:bootpc                *:*                                 4017/dhclient   
udp        0      0 *:bootpc                *:*                                 3425/dhclient   
udp        0      0 *:*                                 900/nmbd        
udp        0      0 MANTHAN-DESK:netbios-ns *:*                                 900/nmbd        
udp        0      0 *:netbios-ns            *:*                                 900/nmbd        
udp        0      0 192.168.42.:netbios-dgm *:*                                 900/nmbd        
udp        0      0 MANTHAN-DES:netbios-dgm *:*                                 900/nmbd        
udp        0      0 *:netbios-dgm           *:*                                 900/nmbd        
udp        0      0 *:43227                 *:*                                 966/Plex DLNA Serve
udp        0      0 MANTHAN-DESKTOP:33368   *:*                                 694/Plex Media Serv
udp        0      0 localhost:49934         *:*                                 694/Plex Media Serv
udp        0      0 *:37737                 *:*                                 966/Plex DLNA Serve
udp        0      0 *:13495                 *:*                                 966/Plex DLNA Serve
udp        0      0 *:42239                 *:*                                 3425/dhclient   
udp6       0      0 [::]:17738              [::]:*                              3425/dhclient   
udp6       0      0 [::]:33559              [::]:*                              4017/dhclient   

NOTE :- BIND9 DNS server is installed in this system but I failed to configure it properly but I hope it has no connection to this problem.

  • dhcpd doesn't seem to be running. Are there any messages when you try to start it? Or any log entries anywhere in /var/log? – Doug Smythies Apr 26 '16 at 6:46

To prevent potential conflict, I would not declare MAC based IP addresses within the same pool that is reserved for regular DHCP addresses. I am suggesting that in your /etc/dhcp/dhcpd.conf file, this:

subnet netmask {

Should be something like this:

subnet netmask {

You do not have enough options declared in your /etc/dhcp/dhcpd.conf file. The important omission, is option routers 192.168.1.???; (use your router IP address).

  • Didn't work... Any other solution. – Siddharth Manthan Apr 26 '16 at 5:58
  • Here's something. When I remove isc-dhcp-server package all my clients get IP adderss but I don't know from where. The server got IP address I would like to change it and set to static. – Siddharth Manthan Apr 26 '16 at 6:37
  • Well, you need to figure that out and disable it. – Doug Smythies Apr 26 '16 at 6:58
  • 1
    Thanks for your interest. Problem solved. Should I mention here how it was solved ?? – Siddharth Manthan Apr 26 '16 at 11:48
  • 2
    Yes, please tell us what the problem was and how you solved it. Either by comment or by writing an answer. – Doug Smythies Apr 26 '16 at 14:17

Ensure that you have cached the latest version of network-manager and network-manager-gnome packages in /var/cache/apt directory.

Failure to do so will create very serious issues as you won't be able to access INTERNET.

How to do it : http://www.tuxradar.com/answers/517

I performed a minimal install so I had it in my cache. Then remove network-manager and network-manager-gnome using following command.

sudo apt-get purge network-manager network-manager-gnome

Then again reinstall and reboot

sudo apt-get install network-manager network-manager-gnome -y && reboot

Find the network interface on which you want to run DHCP server by running the following command in terminal. In my case it was enp2s0. It can be eth0, eth1, etc

ifconfig -a

Now comes the main part. Edit the /etc/network/interfaces file.

sudo gedit /etc/network/interfaces


sudo nano /etc/network/interfaces

Paste the following :

allow-hotplug enp2s0 iface enp2s0 inet static name Lan address netmask network

Replace enp2s0 by your network interface and make other necessary modifications.

For gedit simply save and exit. Nano users save using ctrl + o followed by return (enter) key. Then exit by ctrl + x.

You must have noticed I used allow-hotplug instead of auto. It is because in UBUNTU 15.10 (can't speak about other version) during boot UBUNTU waits for all the auto interface to be UP. Owing to it UBUNTU waits for 2 mins 3 sec (in my case) and then completes the boot process. So in order to reduce the boot time and to not encounter this issue I am using allow-hotplug.

Finally modify the main configuration file as follows :

sudo gedit /etc/dhcp/dhcpd.conf


sudo nano /etc/network/interfaces

ddns-update-style none;

log-facility local7;

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

subnet netmask {
        option subnet-mask;
        option broadcast-address;
        option routers;

The following is for IP reservation. If you want to do it then replace 7c:0b:c6:**:**:43 with mac address of your device.

host TABLET {
hardware ethernet 7c:0b:c6:**:**:43;

Again, for gedit, save and exit. Nano users save using ctrl + o followed by return (enter) key. Then exit by ctrl + x.

Notice that in this configuration address of interfaces file above matches with option routers Similarly network of interfaces matches with subnet The same goes with netmask and subnet-mask.

As mentioned above by Doug Smythies and due to error in configuration I set IP range from because I reserved an IP address Keeping the same IP address in reserved list and IP range creates problems.

A final reboot won't hurt.


If you encounter problems then check the service status using

service isc-dhcp-server status

Because I am an inexperienced UBUNTU user I cannot say why it solved the issue but it did and I am sharing this answer so as to help fellow mates like me who are also inexperienced.

Special Thanks to Doug Smythies for your interest and efforts for the solution. Please make necessary changes and corrections.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.