isc-dhcp-server

The first thing You need to do is install the packages we need.

Open up a terminal and type:

sudo apt-get install isc-dhcp-server

There are two main files /etc/default/isc-dhcp-server and /etc/dhcp/dhcpd.conf which we will need to configure so lets take the first.

Open up a terminal and using your favorite text editor type:

sudo vi /etc/default/isc-dhcp-server

You should get the following:

#Defaults for dhcp initscript
#sourced by /etc/init.d/dhcp
#installed at /etc/default/isc-dhcp-server by the maintainer scripts
#
#This is a POSIX shell fragment
#
#On what interfaces should the DHCP server (dhcpd) serve DHCP requests"
#Separate multiple interfaces with spaces, e.g. “eth0 eth1".
INTERFACES="eth0"

Replace eth0 above with the name of your network interface that you want the server to lease addresses on. Onto the next file.

Open up a terminal and type:

sudo vim /etc/dhcp/dhcpd.conf

which should give you the output below.

#
#Sample configuration file for ISC dhcpd for Debian
#
#Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as
#configuration file instead of this file.
#
#
....
option domain-name “example.org”;
option domain-name-servers ns1.example.org, ns2.example.org;
option domain-name “comtech.com”;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet 10.0.0.0 netmask 255.255.255.0 {
range 10.0.0.150 10.0.0.253;
option routers 10.0.0.2;
option subnet-mask 255.255.255.0;
option broadcast-address 10.0.0.254;
option domain-name-servers 10.0.0.1, 10.0.0.2;
option ntp-servers 10.0.0.1;
option netbios-name-servers 10.0.0.1;
option netbios-node-type 8;
 ......
}

This needs a little bit of explaining.

  1. Adjust your settings according to your network requirements.
  2. The option domain name is your dns zone name. For example mine is set to comtech.com.
  3. Range should be the range of ip addresses that you want the server to give out to clients.

Now restart the dhcp service by typing:

sudo service isc-dhcp-server restart

Thats it!! Your dhcp server should be running, however it is best to check. Open up a terminal and type:

sudo netstat -uap

which will show you something like the following (look for dhcpdnmbd, and named):

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address State PID/Program name
udp        0      0 10.0.0.255:netbios-dgm  *:*                   1016/nmbd
udp        0      0 10.0.0.255:netbios-ns   *:*                   1016/nmbd
udp        0      0 *:bootps                *:*                   4525/dhcpd
udp        0      0 *:netbios-dgm           *:*                   1016/nmbd
udp        0      0 *:netbios-ns            *:*                   1016/nmbd
udp        0      0 chris-desktop:domain    *:*                   1273/named
udp        0      0 chris-desktop.lo:domain *:*                   1273/named
udp        0      0 chris-deskt:netbios-dgm *:*                   1016/nmbd
udp        0      0 chris-deskto:netbios-ns *:*                   1016/nmbd
udp6       0      0 [::]:domain             [::]:*                1273/named
share improve this answer
 
Just a word of caution, make sure to use /etc/dhcp/dhcpd.conf and not /etc/dhcp3/dhcpd.conf –   puk Nov 14 '13 at 23:09
 
When I restart the service this message is shown: stop: Unknown instance: isc-dhcp-server start/running, process 3027. I am not able to start the service. I use Ubuntu 13.10. –   JJD  Apr 13 at 10:53
add comment
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值