Mailing List Archive

root on nfs and multiple ip addresses
Hi,

I have just reinstalled my 32 bit Gentoo on a raspberry pi 3B with a
Gentoo aarch64 image also with boot on an sdcard and root on nfs (both
working fine with boot on an sdcard and root on an nfs share hosted on
an moosefs cluster).  Both have a problem where the initial boot loader
requests an IP address using "IP=dhcp", then the main operating system
requests it again on initialising the interface.  Despite asking using
the same MAC address, ISC dhcp issues a new and different IP address -
this seems counter intuitive so why is it happening?  Have I missed a
configuration option somewhere?

The standard advice is to stop the OS requesting an address (Ubuntu and
the like) - but shouldn't dhcp know that its already issued a valid IP
address to that MAC address?

BillK
Re: root on nfs and multiple ip addresses [ In reply to ]
On Wednesday, March 17, 2021 7:31:52 AM CET William Kenworthy wrote:
> Hi,
>
> I have just reinstalled my 32 bit Gentoo on a raspberry pi 3B with a
> Gentoo aarch64 image also with boot on an sdcard and root on nfs (both
> working fine with boot on an sdcard and root on an nfs share hosted on
> an moosefs cluster). Both have a problem where the initial boot loader
> requests an IP address using "IP=dhcp", then the main operating system
> requests it again on initialising the interface. Despite asking using
> the same MAC address, ISC dhcp issues a new and different IP address -
> this seems counter intuitive so why is it happening? Have I missed a
> configuration option somewhere?
>
> The standard advice is to stop the OS requesting an address (Ubuntu and
> the like) - but shouldn't dhcp know that its already issued a valid IP
> address to that MAC address?
>
> BillK

Normally I get the same IP, but not if the lease is expired:

What is the "default-lease-time" and "max-lease-time" set to on your DHCP
server?

Or it gets "released", which can happen when the client informs the DHCP
server it no longer needs the IP.

Also, why not fix the IP for the MAC on the DHCP server?
Re: root on nfs and multiple ip addresses [ In reply to ]
On 17/3/21 3:46 pm, J. Roeleveld wrote:
> On Wednesday, March 17, 2021 7:31:52 AM CET William Kenworthy wrote:
>> Hi,
>>
>> I have just reinstalled my 32 bit Gentoo on a raspberry pi 3B with a
>> Gentoo aarch64 image also with boot on an sdcard and root on nfs (both
>> working fine with boot on an sdcard and root on an nfs share hosted on
>> an moosefs cluster). Both have a problem where the initial boot loader
>> requests an IP address using "IP=dhcp", then the main operating system
>> requests it again on initialising the interface. Despite asking using
>> the same MAC address, ISC dhcp issues a new and different IP address -
>> this seems counter intuitive so why is it happening? Have I missed a
>> configuration option somewhere?
>>
>> The standard advice is to stop the OS requesting an address (Ubuntu and
>> the like) - but shouldn't dhcp know that its already issued a valid IP
>> address to that MAC address?
>>
>> BillK
> Normally I get the same IP, but not if the lease is expired:
>
> What is the "default-lease-time" and "max-lease-time" set to on your DHCP
> server?
>
> Or it gets "released", which can happen when the client informs the DHCP
> server it no longer needs the IP.
>
> Also, why not fix the IP for the MAC on the DHCP server?
>
>
Hi Joost, I have been moving away from fixed IP's using scripts to
update via dynamic DNS (which is why two IP numbers per MAC are
problematic).  I might fix it on the DHCP server to see what happens. 
The lease times are relatively long considering the boot time. 
Interestingly, dhcp issues the same IP addresses consistently to both
the boot process and OS.  While stopping the OS requesting an address is
easy enough ... the question is why is that necessary.  Google shows a
number of recommendations and howtos saying to do just that but it seems
a "kludge".

BillK
Re: root on nfs and multiple ip addresses [ In reply to ]
On Wed, 17 Mar 2021 15:59:01 +0800, William Kenworthy wrote:

> The lease times are relatively long considering the boot time. 
> Interestingly, dhcp issues the same IP addresses consistently to both
> the boot process and OS.

Is something changing the MAC address of the Pi after initial boot? That
would explain both the issue of two addresses and the consistency of them.


--
Neil Bothwick

At any event, the people whose seats are furthest from
the aisle arrive last.
Re: root on nfs and multiple ip addresses [ In reply to ]
On 3/17/21 8:59 AM, Neil Bothwick wrote:
> Is something changing the MAC address of the Pi after initial
> boot? That would explain both the issue of two addresses and the
> consistency of them.

Compare packet captures of the various DHCP requests and make sure that
they are the same.

There might be some optional parameter that is different between them,
inducing the DHCP server to offer different addresses.



--
Grant. . . .
unix || die
Re: root on nfs and multiple ip addresses [ In reply to ]
On Wed, 17 Mar 2021 15:59:01 +0800
William Kenworthy <billk@iinet.net.au> wrote:


> I have been moving away from fixed IP's using scripts to
> update via dynamic DNS (which is why two IP numbers per MAC are
> problematic).

Joost was probably not suggesting the use of static IPs here, he was
suggesting to fix a certain MAC to a certain IP employing dhcp (or I
didn't understand properly what you both are talking about here ;-).

> Interestingly, dhcp issues the same IP addresses consistently to both
> the boot process and OS.  While stopping the OS requesting an address
> is easy enough ... the question is why is that necessary.  Google
> shows a number of recommendations and howtos saying to do just that
> but it seems a "kludge".

Did you make sure that the two IPs are issued to the same MAC? I don't
have much experience with the ISC server, but I'd think this should not
happen.
Just a wild guess: does the client update its time (by running
ntpclient or similar) during boot so it might think different about the
age of its dhcp lease than the server?


cu
Gerrit
Re: root on nfs and multiple ip addresses [ In reply to ]
On 19/3/21 7:18 pm, Gerrit Kuehn wrote:
> On Wed, 17 Mar 2021 15:59:01 +0800
> William Kenworthy <billk@iinet.net.au> wrote:
>
>
>> I have been moving away from fixed IP's using scripts to
>> update via dynamic DNS (which is why two IP numbers per MAC are
>> problematic).
> Joost was probably not suggesting the use of static IPs here, he was
> suggesting to fix a certain MAC to a certain IP employing dhcp (or I
> didn't understand properly what you both are talking about here ;-).
>
>> Interestingly, dhcp issues the same IP addresses consistently to both
>> the boot process and OS.  While stopping the OS requesting an address
>> is easy enough ... the question is why is that necessary.  Google
>> shows a number of recommendations and howtos saying to do just that
>> but it seems a "kludge".
> Did you make sure that the two IPs are issued to the same MAC? I don't
> have much experience with the ISC server, but I'd think this should not
> happen.
> Just a wild guess: does the client update its time (by running
> ntpclient or similar) during boot so it might think different about the
> age of its dhcp lease than the server?
>
>
> cu
> Gerrit
>
Yes, its two IP's to the same MAC address.  Its a raspberry pi 3B using
swclock so time may be an issue though I dont see how, but its still a
different IP for each stage, but the logs are showing the same MAC
address.  Google shows its a known problem and not just me - but its a
reason why and then a better fix than stopping the OS from starting its
interface that I am looking for.  Yes I understand what Joost is getting
at and I do want to test it but I have a delay:

Unfortunately an ill advised "rm -rf" in my storage system has left me
restoring 7TB of data, so it will be a couple of days more before I have
time again - thank-you borgbackup - you are a life saver!!!!

BillK
Re: root on nfs and multiple ip addresses [ In reply to ]
On 3/19/21 5:55 AM, William Kenworthy wrote:
> Yes, its two IP's to the same MAC address. Its a raspberry pi 3B
> using swclock so time may be an issue though I dont see how, but its
> still a different IP for each stage, but the logs are showing the
> same MAC address. Google shows its a known problem and not just me -
> but its a reason why and then a better fix than stopping the OS from
> starting its interface that I am looking for. Yes I understand what
> Joost is getting at and I do want to test it but I have a delay:

You might consider turning up logging on the DHCP server to see if it
can give you any information on why it's handing out different IPs. It
may be detecting that the IP handed out last time is in use and not
realizing that it's the same system.

I've had good luck with the BIND and INN user community mailing lists
from ISC. I suspect that the DHCP mailing list would be equally helpful.

> Unfortunately an ill advised "rm -rf" in my storage system has left
> me restoring 7TB of data, so it will be a couple of days more before
> I have time again - thank-you borgbackup - you are a life saver!!!!

Ouch! The good news is that you have the data backed up to be able to
restore it. Also, inadvertent and unexpected backup test. :-j



--
Grant. . . .
unix || die