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 installed e configured the DHCP server and removed all network-manager*.

All my settings are just like this one: dhcpd fails to start on eth1 (but i use eth0)

I do:

sudo ifdown eth0
sudo ifup eth0

Then plug the cable between the server and the client. The client receives the correct IP address: 192-168.0.50

BUT, if I unplug the cable and put it back the Client doesn't receive a valid IP address. I have to make sudo ifdown eth0, sudo ifup eth0 at the server to the client receive a valid IP address again.

How do I fix this?

EDIT: my current configuration files are:

$ cat /etc/default/isc-dhcp-server
INTERFACES="eth0"

,

$ cat /etc/dhcp/dhcpd.conf
ddns-update-style none;

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

subnet 192.168.0.0 netmask 255.255.255.0 {
  interface eth0;
  range 192.168.0.50 192.168.0.100;
  option subnet-mask 255.255.255.0;
  option broadcast-address 192.168.0.255;
  option routers 192.168.0.1;
}

,

$ cat /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.0.1
network 192.168.0.0
netmask 255.255.255.0
broadcast   192.168.0.255
#gateway    192.168.0.1

,

$ cat /etc/resolv.conf
nameserver 192.168.0.1

I'm not using any router or switch. Just two PCs connected my cable. After rebooting the server, i have to

$ sudo isc-dhcp-server start

After this the client PC obtains a correct IP. BUT if I unplug the cable and connect it again, it won't get an IP in the correct range. I have to ifdown and then ifup eth0.

share|improve this question

1 Answer 1

If you removed or disabled NetworkManager you need to configure networking manually.

1) Add your nameserver in /etc/resolv.conf

# change '192.168.0.1' to the nameserver you want to use.
nameserver 192.168.0.1

2) Bring your network down.

sudo service networking stop

3) Edit /etc/network/interfaces

# command line
sudo -e /etc/network/interfaces

# graphical
gksu gedit /etc/network/interfaces

Add in your configuration for eth0. With DHCP it is short.

auto eth0
iface eth0 inet dhcp

4) Bring your network up

sudo service networking start

dhcp / networking should then work properly when you re-boot.

share|improve this answer
    
I forget the nameserver at resolv.conf. But It's not from that... (I updated my first post) –  Agent Bretman Dec 16 '11 at 19:54
    
That network configuration is using a static ip, not dhcp. I assume your router is 192.168.0.1, if so, and if you use a static address, you should probably not use "address 192.168.0.1" –  bodhi.zazen Dec 16 '11 at 20:14

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.