I didn’t see the logs for today at first because grep was skipping the rest of /var/log/messages
after seeing some bytes that convinced it that it was a binary file. Anyway, I’ve overcome that and now I see what happened:
Jan 8 11:00:00 approximate time of power and cable service loss
Power restored, cable service not restored
Jan 8 12:12:17 fw dhcpcd[1793]: dhcpcd-9.4.1 starting
Jan 8 12:12:17 fw dhcpcd[1796]: DUID 00:04:03:00:02:00:04:00:05:00:00:06:00:07:00:08:00:09
Jan 8 12:12:18 fw dhcpcd[1796]: red0: waiting for carrier
Jan 8 12:12:21 fw dhcpcd[1796]: red0: carrier acquired
Jan 8 12:12:21 fw dhcpcd[1796]: red0: IAID 14:a0:bc:eb
Jan 8 12:12:21 fw dhcpcd[1796]: red0: adding address fe80::227c:14ff:fea0:bceb
Jan 8 12:12:21 fw dhcpcd[1796]: ipv6_addaddr1: Permission denied
Jan 8 12:12:21 fw dhcpcd[1796]: red0: soliciting an IPv6 router
Jan 8 12:12:22 fw dhcpcd[1796]: red0: rebinding lease of $REDACTED_REAL_IP
Jan 8 12:12:27 fw dhcpcd[1796]: red0: DHCP lease expired
Jan 8 12:12:27 fw dhcpcd.exe[1842]: red0 has been brought down (EXPIRE)
Jan 8 12:12:28 fw dhcpcd[1796]: red0: soliciting a DHCP lease
Jan 8 12:12:49 fw dhcpcd[1796]: red0: carrier lost
Jan 8 12:12:49 fw dhcpcd.exe[2010]: red0 has been brought down (EXPIRE)
Jan 8 12:12:52 fw dhcpcd[1796]: red0: carrier acquired
Jan 8 12:12:52 fw dhcpcd[1796]: red0: IAID 14:a0:bc:eb
Jan 8 12:12:53 fw dhcpcd[1796]: red0: soliciting an IPv6 router
Jan 8 12:12:54 fw dhcpcd[1796]: red0: soliciting a DHCP lease
Jan 8 12:13:17 fw dhcpcd[1796]: red0: carrier lost
Jan 8 12:13:17 fw dhcpcd.exe[2186]: red0 has been brought down (EXPIRE)
Jan 8 12:13:18 fw dhcpcd[1796]: timed out
I manually reboot ipfire before cable service is back, trying to diagnose why there is no Internet.
Jan 8 12:53:43 fw dhcpcd[1729]: dhcpcd-9.4.1 starting
Jan 8 12:53:43 fw dhcpcd[1732]: DUID 00:04:03:00:02:00:04:00:05:00:00:06:00:07:00:08:00:09
Jan 8 12:53:43 fw dhcpcd[1732]: red0: waiting for carrier
Jan 8 12:53:46 fw dhcpcd[1732]: red0: carrier acquired
Jan 8 12:53:46 fw dhcpcd[1732]: red0: IAID 14:a0:bc:eb
Jan 8 12:53:46 fw dhcpcd[1732]: red0: adding address fe80::227c:14ff:fea0:bceb
Jan 8 12:53:46 fw dhcpcd[1732]: ipv6_addaddr1: Permission denied
Jan 8 12:53:47 fw dhcpcd[1732]: red0: soliciting an IPv6 router
Jan 8 12:53:47 fw dhcpcd[1732]: red0: soliciting a DHCP lease
Jan 8 12:54:43 fw dhcpcd[1732]: timed out
It looks like dhcpcd just gives up after 60 seconds!
I rebooted the machine manually after I saw the cable modem had reacquired a link with the ISP.
Jan 8 15:08:12 fw dhcpcd[1733]: dhcpcd-9.4.1 starting
Jan 8 15:08:12 fw dhcpcd[1736]: DUID 00:04:03:00:02:00:04:00:05:00:00:06:00:07:00:08:00:09
Jan 8 15:08:12 fw dhcpcd[1736]: red0: waiting for carrier
Jan 8 15:08:15 fw dhcpcd[1736]: red0: carrier acquired
Jan 8 15:08:15 fw dhcpcd[1736]: red0: IAID 14:a0:bc:eb
Jan 8 15:08:15 fw dhcpcd[1736]: red0: adding address fe80::227c:14ff:fea0:bceb
Jan 8 15:08:15 fw dhcpcd[1736]: ipv6_addaddr1: Permission denied
Jan 8 15:08:15 fw dhcpcd[1736]: red0: soliciting an IPv6 router
Jan 8 15:08:17 fw dhcpcd[1736]: red0: soliciting a DHCP lease
Jan 8 15:08:20 fw dhcpcd[1736]: red0: offered $REDACTED_REAL_IP from $REDACTED_REAL_DCHP_SERVER $REDACTED_DOMAIN
Jan 8 15:08:20 fw dhcpcd[1736]: red0: probing address $REDACTED_REAL_IP/20
Jan 8 15:08:25 fw dhcpcd[1736]: red0: leased $REDACTED_REAL_IP for 216000 seconds
Jan 8 15:08:25 fw dhcpcd[1736]: red0: adding route to $REDACTED_NETWORK/20
Jan 8 15:08:25 fw dhcpcd[1736]: red0: adding default route via $REDACTED_GW
Jan 8 15:08:25 fw dhcpcd.exe[1782]: red0 has been (re)configured with IP=$REDACTED_REAL_IP
The man page for dhcpcd
(I can only find them for non-Linux systems) says:
dhcpcd gets the host information (IP address, routes, etc) from a DHCP
server and configures the network interface of the machine on which it is
running.
...
dhcpcd then daemonises
and waits for the lease renewal time to lapse. It will then attempt to
renew its lease and reconfigure if the new lease changes when the lease
begins to expire or the DHCP server sends a message to renew early.
...
If any interface reports a working carrier then dhcpcd will try to obtain
a lease before forking to the background, otherwise it will fork right
away. This behaviour can be modified with the -b, --background and -w,
--waitip options.
According to this, invoking dhcpcd red0
asks dhcpcd
to start, try to get a lease, and then only if it does, go into the background and try to renew it before it times out.
Based on the log contents and the observed behaviour, it seems like if it doesn’t get a lease within the first 60 seconds, it does not go into the background and keep trying!
I don’t quite understand why the daemon with the job of keeping the interface with an active DHCP lease would decide to not keep trying forever by default, but that certainly sounds like it’s the problem.
The options for fixing these seem to be:
-
Add --timeout 0
so that it tries forever to get a lease. This certainly seems like what I (and most people) would want. However, it doesn’t seem like ipfire would expect this to take place in the foreground while its dhcpcd_start()
function is running, so . . .
-
Add both --timeout 0
and the --background
flag to immediately background and keep trying forever. I think that ipfire is built to handle this judging by the check of $ip_address
in dhcpcd_start()
.
So, I’ll give this a try and report back when I have a chance to test it properly.