LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   DHCP: Problem in assigning fixed address to clients (http://www.linuxquestions.org/questions/linux-networking-3/dhcp-problem-in-assigning-fixed-address-to-clients-383910/)

libregeek 11-17-2005 01:17 AM

DHCP: Problem in assigning fixed address to clients
 
Hello all,
I am trying to configure a ISC DHCP server on my Fedora Core 3 machine. The DHCP version I am using is dhcp-3.0.1-44_FC3. My requirement is that all the machines are assigned an IP via DHCP. However the IP should be same all the time it boots. so I gave the following configuration in /etc/dhcpd.conf:
Quote:

default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.202.255;
option routers 192.168.202.1;
option domain-name-servers 192.168.202.1;
option domain-name "basic.net";
ddns-update-style ad-hoc;

subnet 192.168.202.0 netmask 255.255.255.0 {
range 192.168.202.100 192.168.202.200;

#host nila.basic.net {
# hardware ethernet 00:13:20:20:19:E4;
# fixed-address 192.168.202.101;
#}

host pamba.basic.net {
hardware ethernet 00:134:A6:153;
fixed-address 192.168.202.102;
}
}
When I started the dhcp daemon, it shows the following messages in /var/log/messages:
Quote:

Nov 17 01:36:53 triveni dhcpd: DHCPREQUEST for 192.168.202.199 from 00:13:d4:a6:15:d3 via eth0: lease 192.168.202.199 unavailable.
Nov 17 01:36:53 triveni dhcpd: DHCPNAK on 192.168.202.199 to 00:13:d4:a6:15:d3 via eth0
Nov 17 01:36:53 triveni dhcpd: DHCPDISCOVER from 00:13:d4:a6:15:d3 via eth0
Nov 17 01:36:53 triveni dhcpd: DHCPOFFER on 192.168.202.102 to 00:13:d4:a6:15:d3 via eth0
Nov 17 01:36:53 triveni dhcpd: Dynamic and static leases present for 192.168.202.102. Nov 17 01:36:53 triveni dhcpd: Remove host declaration pamba.ejyothi.net or remove 192.168.202.102
Nov 17 01:36:53 triveni dhcpd: from the dynamic address pool for 192.168.202/24
Nov 17 01:36:53 triveni dhcpd: DHCPREQUEST for 192.168.202.102 (192.168.202.1) from 00:13:d4:a6:15:d3 via eth0
However when using linux clients, the above configuration works, eventhough it shows the above messages. When windows is used the IP is not assigned. what may me the problem?

I am newbie to (Linux )Networking . Can anyone suggest a suitable method so that all the clients(LInux/Windows) are assigned a fixed IP and hostname from the dhcp server. Later on I have to set up a DNS server also in this network. But it's not a priority now.
Any help would be appreciated.
regards
libregeek.

Que_273 11-17-2005 04:23 AM

This line
Code:

host pamba.basic.net {
hardware ethernet 00:134:A6:153;
fixed-address 192.168.202.102;
}

doesn't look right. There are some characters missing (unless they have been taken out as smilies : d :D )

mardanian 11-17-2005 06:51 AM

set you windows machine on automatically detect settings or whatever.

okay here is a hack if your windows machine unable to get ip from your dhcp server then try to disable you lan interface on windows (by right clicking on the local lan icon) and then reenable it.

hope this could helps

askar

libregeek 11-17-2005 07:17 AM

This thing is surely the play of smilies.
Code:

host pamba.basic.net {
hardware ethernet 00:134:A6:153;
fixed-address 192.168.202.102;
}

the correct one is :
Code:

host pamba.basic.net {
                      hardware ethernet 00:13:D4:A6:15:D3;
                fixed-address 192.168.202.103;
        }


libregeek 11-17-2005 07:26 AM

One part of my problem is solved:
It's not possible to include IP address in host part which comes under the "range". I changed the configuration as following:
Code:

default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.202.255;
option routers 192.168.202.1;
#option domain-name-servers 192.168.202.1;
option domain-name-servers 192.168.202.1, 202.138.96.2, 202.138.103.100, 192.168.202.2;
option domain-name "basic.net";
ddns-update-style ad-hoc;

subnet 192.168.202.0 netmask 255.255.255.0 {
        range 192.168.202.200 192.168.202.254;

        #host nila.basic.net {
        #      hardware ethernet 00:13:20:20:19:E4;
        #      fixed-address 192.168.202.101;
        #}

        host pamba.basic.net {
                        hardware ethernet 00:13:D4:A6:15:D3;
                fixed-address 192.168.202.103;
        }
}

But still there si the problem of assigning the hostname. The DHCP server can't assign the hostname. Is it really possible :)

Darin 11-17-2005 12:39 PM

as you found out, the fixed addresses have to be outside the assigned pool.As you found out, the fixed addresses have to be outside the assigned pool, I also usually put them in the config file outside that section as well. If your config works, then I guess it doesn't matter. As for the hostname, I put two commands in my config, as a shotgun approach, I'm not sure which one does the trick but my linux client does get a hostname from the server.

Code:

...
subnet 192.168.202.0 netmask 255.255.255.0 {
        range 192.168.202.200 192.168.202.254;

        host pamba.basic.net {
                hardware ethernet 00:13:D4:A6:15:D3;
                fixed-address 192.168.202.103;
        }
}

would be
Code:

...
subnet 192.168.202.0 netmask 255.255.255.0 {
        range 192.168.202.200 192.168.202.254;
}

host pamba.basic.net {
        hardware ethernet 00:13:D4:A6:15:D3;
        option host-name "pamba";
        ddns-hostname "pamba";

        fixed-address 192.168.202.103;
}


libregeek 11-17-2005 11:59 PM

Your suggestion didn't work for me. I think it's very hard to set in /etc/sysconfig/network. Is there any way to say in the /etc/sysconfig/network, that the hostname should be obtained from dhcp server ?


All times are GMT -5. The time now is 02:03 PM.