Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I m trying to configure dhcp server in ubtuntu onto my virtual box and connecting other virtual instance of ubuntu to this dhcp sever

i have installed dhcp server using sudo apt-get isc-dhcp-server

then i went to /etc/networks/interfaces and wrote this

auto eth0 
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.254
broadcast 192.168.1.255
dns-nameserver 192.168.1.254
dns-search lan

i then restarted networking service using sudo service networking restart

suddenly my GUI crashed and hanged and all that stuff, which forced me to reboot the system. i checked for ip which showed me that i had got it.

then i went to /etc/default/isc-dhcp-server and made this change INTERFACES="eth0"

then i went to /etc/dhcp/dhcpd.conf and wrote the following lines

ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers-192.168.2.1;
option domain-name "ttc.com";
subnet 192.168.1.0 netmask 255.255.255.0
{
range 192.168.1.20 192.168.1.30;
} 

i restarted the service using sudo services isc-dhcp-server but it says: stop: unknown instance: start: Job failed to start

i also tried to start dhcp server using the command sudo service isc-dhcp-server start

but when i tried sudo start isc-dhcp-server or sudo status isc-dhcp-server it shows me an error of iscinitctl: Unable to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket. No such file or directory.

i don't know what to do now so please give me some guidence solving this error. I would like to provide more details i needed.

share|improve this question
    
Let's start with asking if you really need / want to use isc? The new default for Ubuntu is dnsmasq. Deviating from this path is always asking for a lot of work and possible additional problems with upgrades. If you do not need to you are better of using the default. –  Requist Jan 1 at 16:36
    
well the reason of using isc is just that it was one way mentioned in the tutorial that i went through. I am just trying to learn these things. I would try using dnsmasq(in some other vm) but on the other side i would like to solve these error. So please help me in solving these error. –  avaj Jan 2 at 5:53
    
I don't know, maybe lesson number one is not to deviate unless you have a very good reason to do so. Step 1 which you did is to overrule network manager which is now the default to handle all network connections in Ubuntu, this in turn stopped the dbus which is at the core of the system. It is possible, I ran this config on 12.04 LTS server, but overly complex and unwise unless you really have to and know what you're doing. I'll have a look at why dbus stopped working, effectively killing your system, but I strongly recommend you to go back to nm and dnsmasq. –  Requist Jan 2 at 9:56

2 Answers 2

Probably access to dbus is denied by apparmor. To bypass security on this please run: sudo aa-copmplain /usr/sbin/dhcpd then restart isc by use of: sudo service isc-dhcp-server start

You can check if it is running using: ps aux |grep dhcpd and see if it's listening by use of: netstat -ln |grep 67

share|improve this answer
    
i tried these but after sudo service isc-dhcp-server start it still gives me start: Job failed to start –  avaj Jan 3 at 3:52
    
That is strange, here I test-installed and it runs without problems (after aa-complain). I am sorry, but for me it feels a bit pointless to spend a lot of time getting this combination running. I'll say, purge isc, reconfig nm and use dnsmasq. –  Requist Jan 3 at 9:13

Seems like you need a space instead of dash,

You have:

option domain-name-servers-192.168.2.1;

But it should be:

option domain-name-servers 192.168.2.1;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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