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).
#DHCPD_CONF=/etc/dhcp/dhcpd.conf
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPD_PID=/var/run/dhcpd.pid
# Additional options to start dhcpd with.
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="enp2s0"
And my /etc/dhcp/dhcpd.conf:
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.33 192.168.1.200;
}
host server {
hardware ethernet 00:1D:92:EA:DB:3C;
fixed-address 192.168.1.33;
}
host tablet {
hardware ethernet 7C:0B:C6:B4:EE:43;
fixed-address 192.168.1.34;
}
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 127.0.0.1;
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";
#reject 192.33.137.209;
#alias {
# interface "eth0";
# fixed-address 192.5.5.213;
# option subnet-mask 255.255.255.255;
#}
#lease {
# interface "eth0";
# fixed-address 192.33.137.200;
# medium "link0 link1";
# option host-name "andare.swiftmedia.com";
# option subnet-mask 255.255.255.0;
# option broadcast-address 192.33.137.255;
# option routers 192.33.137.250;
# option domain-name-servers 127.0.0.1;
# 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 192.168.42.2:netbios-ns *:* 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.