manually forcing a IP renewal

Derek Broughton news at pointerstop.ca
Mon Nov 26 23:48:24 UTC 2007


Brian McKee wrote:

> On 26-Nov-07, at 4:06 PM, Derek Broughton wrote:
> 
>> Brian McKee wrote:
>>>> When he removes this ubuntu computer and connect his Windows
>>>> computer,
>>>> the windows computers gets a ip right away.
>>>
>>> I believe Windows does not release IP addresses  by default.
>>> Try ipconfig /release on the Windows box before you shut it down,
>>> then start up the Linux box and see if it gets issued something.
>>
>> It's worth a try, but I don't believe it can make a difference.  As
>> far as
>> the DHCP server is concerned, your computer has no OS.  All it sees
>> is a
>> MAC address.  Since that is the same when you're running in Ubuntu or
>> Windows, you should (and I always do) get the same IP address from the
>> server
> 
> Well, it's been a bit since I was poking at this, so I may be
> remembering this incorrectly, but - the dhcp server in the cable
> modem only has a limited number of addresses it will assign (two for
> my local cable company) and if Windows doesn't release it's lease,
> then there aren't any more available until one times out, 

That's true (it's actually true of any DHCP server, but properly configured
ones will have more than enough...) but every time you power up that
Windows PC it will _also_ ask for an address.  What the DHCP server does is
check its leases and say - "OK, this MAC requested - and got - x.x.x.x, and
since the lease hasn't expired, I'll resend it".  So when the Linux box -
with the same MAC - does the same, it _should_ get the existing lease.

> When he says the Windows computer gets an ip right away, in fact it's
> just using the one it had when it shut down.

No, it's not.  It still asks the DHCP server - the DHCP server may in fact
refuse to let it use the old address (DHCP servers are not bound to accept
any request from the client - for instance, the client will usually
say "give me an IP, and call me BOBO", and the ISP's server will send the
IP and say "but I'm going to call you "client-x-x-x-x").

> You are right that the modem doesn't care what's plugged into it - if
> he tried a new Windows computer it wouldn't work either.

But it would if he was using a PC-card interface, and took it out of the old
Windows machine and put it in the new one.

> Some cable companies preprogram an allowed MAC address into their
> modems and ask you for that address when you set up your account with
> them.  That's why a lot of home routers have a option to assign MAC
> numbers to their WAN port.   If it was something like that he could
> flop ethernet cards between the Windows box and the linux box just to
> prove it,  but that doesn't quite fit the symptoms he reports.

Agreed.  If that was actually the case, he could force his Linux NIC to
report the correct MAC too. 

> Hope that makes sense,

It makes sense - it's just not entirely right :-)
-- 
derek





More information about the ubuntu-users mailing list