Re: long delay getting address from ISP w/-current dhcpcd

2017-07-25 Thread Roy Marples
Hi John

On 24/07/2017 21:46, John D. Baker wrote:
> On Mon, 24 Jul 2017, John D. Baker wrote:
> 
>> Now that it has generated a new DUID (and once the ISP's DHCP server
>> issues a lease for it), I'll need to be sure and copy the "duid" file
>> as "/etc/dhcpcd.duid" for the netbsd-7 installation on the CF card.
>> Then, an update to netbsd-8 will migrate it to "/var/db/dhcpcd/duid".
> 
> This seems to have been a case of different DUID values between the
> local disk (CF) installation and the NFS-root installation and the ISP's
> behavior when being presented with a DUID of which it doesn't yet have
> (or no-longer has) a record.
> 
> Copying the "/var/db/dhcpcd/duid" file from the -current NFS install to
> "/etc/dhcpcd.duid" on the netbsd-7 CF install ensured that either case
> would get an address quickly.  The subsequent upgrade to 8.0_BETA migrated
> the "/etc/dhcpcd.duid" file to "/var/db/dhcpcd/duid" and everything is
> working nicely now.

Glad it working nicely for you now!
Maybe we should put something about this change in some upgrade notes if
we have any?

> Now, to keep this behavior in mind should I put my old SS5-based router
> back into service or replace it with an ERLITE or one of the supported
> RouterBoard products.

Now you know the root cause, whatever you put in place is entirely your
choice.
I myself run an ERLITE router with dhcpcd to negotiate stuff (although
just from the cable modem which has it's own DHCP server) - but it boots
entirely off the USB stick and not NFS as some like to do.

Roy


Re: long delay getting address from ISP w/-current dhcpcd

2017-07-24 Thread John D. Baker
On Mon, 24 Jul 2017, John D. Baker wrote:

> Now that it has generated a new DUID (and once the ISP's DHCP server
> issues a lease for it), I'll need to be sure and copy the "duid" file
> as "/etc/dhcpcd.duid" for the netbsd-7 installation on the CF card.
> Then, an update to netbsd-8 will migrate it to "/var/db/dhcpcd/duid".

This seems to have been a case of different DUID values between the
local disk (CF) installation and the NFS-root installation and the ISP's
behavior when being presented with a DUID of which it doesn't yet have
(or no-longer has) a record.

Copying the "/var/db/dhcpcd/duid" file from the -current NFS install to
"/etc/dhcpcd.duid" on the netbsd-7 CF install ensured that either case
would get an address quickly.  The subsequent upgrade to 8.0_BETA migrated
the "/etc/dhcpcd.duid" file to "/var/db/dhcpcd/duid" and everything is
working nicely now.

Now, to keep this behavior in mind should I put my old SS5-based router
back into service or replace it with an ERLITE or one of the supported
RouterBoard products.

-- 
|/"\ John D. Baker, KN5UKS   NetBSD Darwin/MacOS X
|\ / jdbaker[snail]mylinuxisp[flyspeck]comOpenBSDFreeBSD
| X  No HTML/proprietary data in email.   BSD just sits there and works!
|/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645



Re: long delay getting address from ISP w/-current dhcpcd

2017-07-24 Thread John D. Baker
On Sun, 23 Jul 2017, John D. Baker wrote:

> I'm using the stock "dhcpcd.conf" file.  Although there was a previous
> "dhcpcd.duid" file generated via internal interface "sip0", after moving
> it aside, a new one is not generated for "sip2".  ("sip0" is configured
> statically.)

I just realized that 'dhcpcd' in -8 and -current migrated a number of
files to "/var/db/dhcpcd/*".  The old "/etc/dhcpcd.duid" was still lying
around from before that change.  I moved "/var/db/dhcpcd/duid" aside and
a new one was generated.  I've since removed the obsolete files.

Before doing that, rebooting the router (again netboot of 8.99.1) acquired
a lease right away.  After that, (while composing this message), it is
again taking a long time to get a lease.  Although the ISP's lease time
is only 30 minutes, it appears to take much longer than that for it to
accept the new DUID and issue a lease.  (39+ minutes as of this attempt.)

Now that it has generated a new DUID (and once the ISP's DHCP server
issues a lease for it), I'll need to be sure and copy the "duid" file
as "/etc/dhcpcd.duid" for the netbsd-7 installation on the CF card.
Then, an update to netbsd-8 will migrate it to "/var/db/dhcpcd/duid".


I also noticed that 'ifconfig' in -current (and presumedly -8) no longer
marks alias addresses with the "alias" keyword.  I'll need to adjust my
"dhcpcd.exit-hook" script to deal with this.

-- 
|/"\ John D. Baker, KN5UKS   NetBSD Darwin/MacOS X
|\ / jdbaker[snail]mylinuxisp[flyspeck]comOpenBSDFreeBSD
| X  No HTML/proprietary data in email.   BSD just sits there and works!
|/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645



Re: long delay getting address from ISP w/-current dhcpcd

2017-07-24 Thread John D. Baker
On Mon, 24 Jul 2017, Martin Husemann wrote:

> On Sun, Jul 23, 2017 at 10:20:50PM -0500, John D. Baker wrote:
> > Anyone else using a Soekris box with netbsd-8 or -current and 'dhcpcd'
> > for acquiring the public IP from their ISP?  Seeing long delays?
> 
> Can you show the ifconfig output while it tries to acquire the address?

I was not able to capture it, but watching it, no IP was assigned for
about the first minute after starting 'dhcpcd'.  Then, it maintained an
IPv4LL address (at first TENTATIVE, later not so) until it was finally
able to obtain the routable address from the ISP about 45 minutes later.

I have a custom "dhcpcd.exit-hook" script that watches for address
changes and installs an alias address so the ADSL modem's local
configuration network (HTTP- and telnet-based status/config utilities)
is reachable.  The script also ensures that this alias truly is an
alias so the DHCP-acquired address remains the primary address for the
benefit of my 'pf' rule set.

In my early testing, I'd moved the "dhcpcd.exit-hook" aside.  When I
put it back, the only noticable change was a complaint from 'ifconfig'
that it couldn't assign requested address during network configuration
at boot time ("/etc/rc.d/network"), probably because there was no alias
to remove yet.  The alias address was then installed properly.

The interface remained in that state (IPv4LL primary address plus
RFC1918 alias address) until the routable address was finally acquired.

I suspect there is a time element involved.  During later testing, if
I reboot the router, it will resume its lease right away.  If the router
remains offline long enough, when it comes back up it will again take
a very long time to acquire a new lease.

If it means anything, the ISP's lease time is only 30 minutes (1800 sec).

-- 
|/"\ John D. Baker, KN5UKS   NetBSD Darwin/MacOS X
|\ / jdbaker[snail]mylinuxisp[flyspeck]comOpenBSDFreeBSD
| X  No HTML/proprietary data in email.   BSD just sits there and works!
|/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645



Re: long delay getting address from ISP w/-current dhcpcd

2017-07-24 Thread Martin Husemann
On Sun, Jul 23, 2017 at 10:20:50PM -0500, John D. Baker wrote:
> Anyone else using a Soekris box with netbsd-8 or -current and 'dhcpcd'
> for acquiring the public IP from their ISP?  Seeing long delays?

Can you show the ifconfig output while it tries to acquire the address?

Martin