related to leases...........need help plzz....

Simon Hobson dhcp1 at thehobsons.co.uk
Mon Feb 12 23:33:30 UTC 2007


hitesh sharma wrote:

>actualiy , i want to know that ,
>1>  when i am using fixed address (leases statement inside the .conf file),
>then how to limit this address , i.e. if i want to use fixed address at
>certain time?

Not sure what the question is. Are you asking for conditional 
allocation, eg "client X can have address a.b.c.d but only between 
9am and 5pm" ?

Firstly, I am not aware of any DHCP server offering any such 
function, and in any case it would be non trivial to implement - each 
time the client renews a lease you would have to compute the time the 
lease is to remain valid and offer a lease that does not exceed that 
time. Certainly a lot more work than "is the time within the 
specified time window".

Remember that DHCP is NOT a security protocol, it is trivial to 
bypass such restrictions by manually configuring a client. If you 
need to restrict use of systems, then there are generally better ways 
of doing it.

>2>  if , i want that , if my machine is using fixed address , but 
>when any server comes inro lan , it should detect that server , and 
>produce request for leases.

No, or at least not 'out of the box'. The server does not broadcast 
it's presence, it is up to the client to ask. Yes it would be 
possible to configure a system to repeatedly attempt to lease an 
address and switch between the dhcp lease and another statically 
configured address depending on whether you get a reply - but that 
defeats the object of dhcp which is to reduce or eliminate 
configuration of clients. What you are asking for would significantly 
increase the administrative burden of managing clients.

What many clients DO support is dynamically allocated "link local" 
addresses - ie they will attempt to obtain a lease by dhcp, but if 
they fail then they will allocate themselves an address in the 
reserved "link local" range. If a dhcp server comes onto the network, 
then (normally) these clients will get a lease because the client 
will keep broadcasting for a dhcp server every few minutes. This is 
entirely client specific and has no effect whatsoever on the dhcp 
server.

>  3>   In case of fixed address, the renew , expire and rebind statement is
>compulsory ? can i declare leases statement without that ? if not , 
>then what is significance of them?

Can you clarify the question ?

In general, there are no mandatory configuration options for the 
client, and very few for the server.

>4>   i face one more problem , when i release the one of the leases 
>(eth0/eth1), by using  -r flag , then after sometime , it also take 
>the leases
>from server. so , how to avoid leases , when one of the or both 
>interface don't want  leases , but even need to be in lan?

Sorry, I don't understand the question.

>6>    when i m releasing the lease , and i want message related to 
>that ie. message no. 7 , then , how to get it ?



>7>    in  /var/lib/dhcp ,  in .leases file , it will comntain all leases,
>or only those are valid ?

It may well contain older records as well.

>8>    we know that , at the 50 % time of  leases, client  try the 
>renew it if it successes in that , remaining   50%  leases first 
>will use by client then new allocated leases , or , client will use 
>new leases , n but remaining 50% leases in leases database.

Once a new lease is issued, the expiry time of the previous lease is 
irrelevant, the new expiry time is whatever the server offers in the 
new lease - this can be (if the configuration has changed) shorter 
than the previous one !

Eg, suppose lease time is set to 4 days, and client is started at 9am 
Monday, it will get a lease expiring at 9am Friday. Suppose 
administrator changes lease time to 1 day after this lease is issued, 
this will NOT affect the clients exiting lease. At 9am on Wednesday 
(after 2 days, 50% of the original lease time), the client will renew 
the lease, the server will offer it a 1 day lease, and if the client 
accepts it, it will now have a lease expiring at 9am Thursday.

If the config had not been changed, then the new lease would also be 
for 4 days and would expire 9am Sunday.

Bear in mind that the 50% time for attempting a renewal is only a 
default, and may also be client specific.


More information about the dhcp-users mailing list