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 have an Ubuntu server that runs DHCP server. DHCP server works good normally, but when I want to assign fixed IP address for my clients, it doesn't work.

My codes in dhcp server in dhcpd.conf look like:

sxalid-s -> my client name

host sxalid-s {
        hardware ethernet 08:00:27:5e:ce:d8;
        fixed-address 192.168.1.9;
}

My subnet declaration:

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.20;
option routers 192.168.1.0;
}

My sxalid-s client before I assign fixed address give 192.168.1.12 but now when I down that interface and up it again give again 192.168.1.12

I try #dhclient but it does not work! I want no more configuration except the default configuration.

Can anybody help me how solve this problem?

share|improve this question

1 Answer 1

In the file /var/lib/dhcp/dhclient.leases you can see your dhcp leases.

When you flush this file that it is empty, you should get a new ip address. Type:

echo -n "" >/var/lib/dhcp/dhclient.leases

And then again:

dhclient -v eth0

If it still doesn't work, then I think your hostname is not sent via dhcp and the dhcp-server cannot fit the host-statement for you. In the file /etc/dhcp/dhclient.conf there is a directive called send host-name:

user@host:~# grep "send host-name" /etc/dhcp/dhclient.conf
send host-name "<hostname>";

In my case it's disabled. Enter your hostname in this statement to enable dhclient to send the host-name within the dhcp-request:

send host-name "sxalid-s";

If it still doesn't work, please add the contents of /var/log/syslog (of the dhcp-server) during the dhcp request to your question.

share|improve this answer
    
don't work. but finally I reboot server and now work properly. –  xalid Nov 1 '13 at 14:35

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.