I’ve got a problem that’s recently gotten worse on my LAN. Starlink will stop working and my Ubiquiti router fails over to the backup. But then it never switches back even though it looks like Starlink is up. It appears to be a DHCP failure; my router can’t get an address for the Dishy interface.
Sometimes rebooting the router fixes it; that suggests it’s a UnifiOS problem. Sometimes I have to turn Dishy off for 10+ minutes and then it starts working again, suggesting it’s a Starlink problem. Or maybe it’s more complicated. Today when this happen I rebooted the router but not Dishy. It started working after a minute or three.
This problem has occurred off and on for two years but is now happening about once a day. Rebooting the router seems the best way to get it working again. But I think the problem has fixed itself at least once (after several hours). I may also have had to turn Dishy off entirely for awhile to get things working.
I know from other sources that Starlink’s ground infrastructure has some sort of reset that happens if Dishy is offline for a few minutes, so often unplugging for awhile fixes things. I also know DHCP has to go all the way through the satellite to the Starlink ground station, so if the network is overloaded it’s not as reliable. But this big failure happens at quiet times too, like just now at 7am.. Finally I know UnifiOS also has bugs in its failover system. So many bugs; I probably won’t buy another Ubiquiti product.
An idea for a fix.
I’m trying a fix right now, putting a Netgear ethernet switch between my router and the Dishy PoE injector. I’ve seen signs in the logs that maybe the ethernet link is failing. And coming back, but maybe that’s not working right? I’ve heard other folks suggest a switch may help smooth out problems.
DHCP Logs
I’ve got logs from the router. They are spammy so I’m narrowing in on just the DHCP part like this. grep DHCP *.1.log | grep -v eth1. Here’s what it looks like when things are going well:
2023-01-22T15:02:21,354 <30>Jan 22 07:02:21 ubnt dhclient: DHCPREQUEST on eth0 to 100.64.0.1 port 67
2023-01-22T15:02:21,440 <30>Jan 22 07:02:21 ubnt dhclient: DHCPACK from 100.64.0.1
2023-01-22T15:04:34,843 <30>Jan 22 07:04:34 ubnt dhclient: DHCPREQUEST on eth0 to 100.64.0.1 port 67
2023-01-22T15:04:34,918 <30>Jan 22 07:04:34 ubnt dhclient: DHCPACK from 100.64.0.1
2023-01-22T15:07:03,124 <30>Jan 22 07:07:03 ubnt dhclient: DHCPREQUEST on eth0 to 100.64.0.1 port 67
2023-01-22T15:07:03,208 <30>Jan 22 07:07:03 ubnt dhclient: DHCPACK from 100.64.0.1
Starlink leases are 5 minutes. So the router requests a new address from the 100.64.0.1 endpoint it knows about every 2.5 minutes and all is well.
Here’s what it looks like when it fails:
2023-01-22T15:07:03,124 <30>Jan 22 07:07:03 ubnt dhclient: DHCPREQUEST on eth0 to 100.64.0.1 port 67
2023-01-22T15:07:03,208 <30>Jan 22 07:07:03 ubnt dhclient: DHCPACK from 100.64.0.1
2023-01-22T15:08:37,364 <30>Jan 22 07:08:37 ubnt dhclient: DHCPRELEASE on eth0 to 100.64.0.1 port 67
2023-01-22T15:08:45,935 <30>Jan 22 07:08:45 ubnt dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
2023-01-22T15:08:45,988 <30>Jan 22 07:08:45 ubnt dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
2023-01-22T15:08:45,988 <30>Jan 22 07:08:45 ubnt dhclient: DHCPOFFER from 100.64.0.1
2023-01-22T15:08:52,524 <30>Jan 22 07:08:52 ubnt dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
2023-01-22T15:09:07,104 <30>Jan 22 07:09:07 ubnt dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
2023-01-22T15:09:07,171 <30>Jan 22 07:09:07 ubnt dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
2023-01-22T15:09:07,171 <30>Jan 22 07:09:07 ubnt dhclient: DHCPOFFER from 100.64.0.1
2023-01-22T15:09:14,163 <30>Jan 22 07:09:14 ubnt dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
2023-01-22T15:09:25,674 <30>Jan 22 07:09:25 ubnt dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
2023-01-22T15:09:25,766 <30>Jan 22 07:09:25 ubnt dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
2023-01-22T15:09:25,767 <30>Jan 22 07:09:25 ubnt dhclient: DHCPOFFER from 100.64.0.1
The log starts with one working exchange. Then 1.5 minutes later my router spontaneously sent a DHCPRELEASE out to Starlink. Um, why? After that my router starts DHCP from ground zero, broadcasting DHCPDISCOVER and DHCPREQUEST on the link to 255.255.255.255. It’s lost all DHCP state. It logs that it got a DHCPOFFER from 100.64.0.1 and that’s good, right? But apparently Ubiquiti didn’t like the offer or ignored it because it just tries again in a few seconds. It gets stuck in this state, sending DISCOVER several times a minute, getting offers, and never working.
Here’s what happens after I reboot the router. Starlink didn’t come back right away after the reboot but did start working pretty quickly, within a minute or so.
2023-01-22T16:10:58,089 <13>Jan 22 08:10:58 ubnt shutdown[3967]: shutting down for system reboot
2023-01-22T16:13:28,518 <86>Jan 22 08:13:01 ubnt sudo: pam_unix(sudo:session): session closed for user root
2023-01-22T16:13:28,567 <86>Jan 22 08:13:01 ubnt sudo: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/sh -c echo \"LAN\" >/sys/class/net/eth1/ifalias
...
2023-01-22T16:13:34,806 <30>Jan 22 08:13:08 ubnt dhclient: DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 6
2023-01-22T16:13:34,809 <30>Jan 22 08:13:08 ubnt dhclient: DHCPREQUEST on eth2 to 255.255.255.255 port 67
2023-01-22T16:13:34,809 <30>Jan 22 08:13:08 ubnt dhclient: DHCPOFFER from 10.33.1.1
2023-01-22T16:13:34,811 <30>Jan 22 08:13:08 ubnt dhclient: DHCPACK from 10.33.1.1
2023-01-22T16:14:16,367 <30>Jan 22 08:13:49 ubnt dhclient: DHCPREQUEST on eth2 to 255.255.255.255 port 67
2023-01-22T16:14:16,381 <30>Jan 22 08:13:49 ubnt dhclient: DHCPACK from 10.33.1.1
2023-01-22T16:14:16,408 <30>Jan 22 08:13:49 ubnt dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
2023-01-22T16:14:16,470 <30>Jan 22 08:13:49 ubnt dhclient: DHCPACK from 100.64.0.1
2023-01-22T16:16:14,856 <30>Jan 22 08:16:14 ubnt dhclient: DHCPREQUEST on eth0 to 100.64.0.1 port 67
2023-01-22T16:16:14,912 <30>Jan 22 08:16:14 ubnt dhclient: DHCPACK from 100.64.0.1
So the system requests reboot at 08:10:58 and finally reboots at 08:13:01. 7 seconds later it makes a DHCP request on eth2; that’s my backup WAN. It works. No hint of anything on eth0, the primary WAN which Dishy is plugged into. Why? But it gets around to asking for eth0 at 08:13:49, 41 seconds later, and it works. Another routine request succeeds at 08:16:14. We’re back online with Starlink.
More logs
Those samples above are all logs filtered on “DHCP”, but maybe important stuff is hiding in the other log spam. Here’s more detailed logs of the failure around 07:08:37 when the mystery DHCPRELEASE happened. Still doing a bit of filtering egrep -v 'mcad|ipsec|pam_unix' *.1.log
2023-01-22T15:07:03,124 <30>Jan 22 07:07:03 ubnt dhclient: DHCPREQUEST on eth0 to 100.64.0.1 port 67
2023-01-22T15:07:03,208 <30>Jan 22 07:07:03 ubnt dhclient: DHCPACK from 100.64.0.1
2023-01-22T15:07:07,613 <30>Jan 22 07:07:07 ubnt dhclient: bound to 100.103.201.245 -- renewal in 115 seconds.
2023-01-22T15:08:35,284 <30>Jan 22 07:08:35 ubnt netplugd[3542]: eth0: state ACTIVE flags 0x00011043 UP,BROADCAST,RUNNING,MULTICAST,10000 -> 0x00001003 UP,BROADCAST,MULTICAST
2023-01-22T15:08:35,284 <190>Jan 22 07:08:35 ubnt zebra[753]: interface eth0 index 2 changed <UP,BROADCAST,MULTICAST>.
2023-01-22T15:08:35,284 <30>Jan 22 07:08:35 ubnt netplugd[25603]: /etc/netplug/netplug eth0 out -> pid 25603
2023-01-22T15:08:35,293 <5>Jan 22 07:08:35 ubnt kernel: eth0: Link down
2023-01-22T15:08:35,951 <181>Jan 22 07:08:35 ubnt wlb: wlb-wan_failover-eth0 wlb-wan_failover-eth0 reachability failed, failover
2023-01-22T15:08:35,951 <181>Jan 22 07:08:35 ubnt wlb: group wan_failover, interface eth0 going Inactive
2023-01-22T15:08:36,211 <181>Jan 22 07:08:36 ubnt wlb: group wan_failover, interface eth2 going Active
2023-01-22T15:08:36,258 <13>Jan 22 07:08:36 ubnt wan-event: [WAN Transition] eth0 to state inactive
2023-01-22T15:08:36,659 <13>Jan 22 07:08:36 ubnt wan-event: [WAN Transition] eth2 to state active
2023-01-22T15:08:36,671 <86>Jan 22 07:08:36 ubnt sudo: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/conntrack -F
2023-01-22T15:08:37,260 <86>Jan 22 07:08:37 ubnt sudo: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/sbin/dhclient -q -cf /var/run/dhclient_eth0.conf -pf /var/run/dhclient_eth0.pid -lf /var/run/dhclient_eth0.leases -r eth0
2023-01-22T15:08:37,324 <30>Jan 22 07:08:37 ubnt netplugd[3542]: eth0: state OUTING flags 0x00001003 UP,BROADCAST,MULTICAST -> 0x00011043 UP,BROADCAST,RUNNING,MULTICAST,10000
2023-01-22T15:08:37,324 <190>Jan 22 07:08:37 ubnt zebra[753]: interface eth0 index 2 changed <UP,BROADCAST,RUNNING,MULTICAST>.
2023-01-22T15:08:37,333 <5>Jan 22 07:08:37 ubnt kernel: eth0: 1000 Mbps Full duplex, port 0
2023-01-22T15:08:37,364 <30>Jan 22 07:08:37 ubnt dhclient: DHCPRELEASE on eth0 to 100.64.0.1 port 67
2023-01-22T15:08:38,875 <86>Jan 22 07:08:38 ubnt sudo: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/sbin/ip route add 0.0.0.0/0 via 100.64.0.1 table 201
2023-01-22T15:08:38,965 <86>Jan 22 07:08:38 ubnt sudo: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/sbin/ip route add blackhole 0.0.0.0/0 table 201 metric 256
2023-01-22T15:08:39,707 <30>Jan 22 07:08:39 ubnt ntpd[2874]: Deleting interface #36 eth0, 100.103.201.245#123, interface stats: received=58, sent=58, dropped=0, active_time=6861 secs
2023-01-22T15:08:39,708 <30>Jan 22 07:08:39 ubnt ntpd[2874]: 65.108.121.104 interface 100.103.201.245 -> (null)
2023-01-22T15:08:39,708 <30>Jan 22 07:08:39 ubnt ntpd[2874]: 205.206.70.42 interface 100.103.201.245 -> (null)
2023-01-22T15:08:39,708 <30>Jan 22 07:08:39 ubnt ntpd[2874]: 103.242.68.69 interface 100.103.201.245 -> (null)
2023-01-22T15:08:39,708 <30>Jan 22 07:08:39 ubnt ntpd[2874]: 144.76.76.107 interface 100.103.201.245 -> (null)
2023-01-22T15:08:41,079 <86>Jan 22 07:08:41 ubnt sudo: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/ubnt-add-connected.pl
2023-01-22T15:08:41,610 <86>Jan 22 07:08:41 ubnt sudo: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/rm -f /var/run/dhclient_eth0.pid
2023-01-22T15:08:42,643 <86>Jan 22 07:08:42 ubnt sudo: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/opt/vyatta/sbin/vyatta-interfaces.pl --dev eth0 --restore-ipv6
2023-01-22T15:08:44,308 <30>Jan 22 07:08:44 ubnt netplugd[3542]: eth0: state OUTING pid 25603 exited status 0
2023-01-22T15:08:44,309 <30>Jan 22 07:08:44 ubnt netplugd[25761]: /etc/netplug/netplug eth0 in -> pid 25761
2023-01-22T15:08:45,718 <86>Jan 22 07:08:45 ubnt sudo: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/sh -c /sbin/dhclient -q -nw -cf /var/run/dhclient_eth0.conf -pf /var/run/dhclient_eth0.pid -lf /var/run/dhclient_eth0.leases eth0 2> /dev/null &
2023-01-22T15:08:45,935 <30>Jan 22 07:08:45 ubnt dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
2023-01-22T15:08:45,988 <30>Jan 22 07:08:45 ubnt dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
2023-01-22T15:08:45,988 <30>Jan 22 07:08:45 ubnt dhclient: DHCPOFFER from 100.64.0.1
I’ve put line breaks in logical groupings. Group 1 is a normal good DHCP exchange. Group 2 is 90 seconds later and looks like eth0 spontaneously went down. There’s nothing in the logs to explain why that might have happened. Group 3 is the failover system correctly realizing eth0 isn’t working and switching me to my backup WAN, eth2. Group 4 is eth0 coming back up just about 2 seconds after it went down. Note that the router sends the DHCPRELEASE at the end of this little group.
It then takes a good 7 seconds until the last group when the router sends a DHCPDISCOVER out the Dishy interface. Why so long? And even though it gets a DHCPOFFER reply immediately the router doesn’t seem to use it. And then we’re back to the logfile above; there’s no extra info in the extended logs to shed light on why it’s not accepting the offer.
So my guess of what’s going on based on these logs is..
- Hardware gremlins cause eth0 to fail
- The router correctly shuts down the eth0 interface and fails over
- eth0 comes back up 2 seconds later
- The router correctly releases the DHCP lease, then tries to get a new one
- Starlink ?correctly? sends a DHCP offer as soon as asked
- The router bugs out and fails to use the lease. It keeps trying several times a minute.
- I have to reboot the router to fix it, or it magically fixes itself after minutes / hours.
These are all pretty rough guesses though. I’m poking at two black boxes with one crappy logfile as my only evidence. Anyway I put a switch in the path to maybe help defend against hardware gremlins. We’ll see. Update: so far so good, 7 days without a disconnect. OTOH the old setup used to go a week+ without a problem too so not certain. I’ve seen other failovers but nothing related to eth0 going down.
eth0 goes down a lot
I should note that eth0 seems to go down a lot; several times a day. But not every day? There’s a gap of a whole week where it never once went down, then another gap of a day+. Super weird. Anyway the DHCP failure doesn’t happen every single time eth0 goes down.
# grep -h 'eth0: Link down' *.1.log* | sort -n
2023-01-10T11:27:19,663 <5>Jan 10 03:27:19 ubnt kernel: eth0: Link down
2023-01-10T11:27:36,793 <5>Jan 10 03:27:36 ubnt kernel: eth0: Link down
2023-01-10T13:22:33,664 <5>Jan 10 05:22:33 ubnt kernel: eth0: Link down
2023-01-10T15:17:28,666 <5>Jan 10 07:17:28 ubnt kernel: eth0: Link down
2023-01-10T17:12:23,981 <5>Jan 10 09:12:23 ubnt kernel: eth0: Link down
2023-01-18T02:22:33,753 <5>Jan 17 18:22:33 ubnt kernel: eth0: Link down
2023-01-18T04:52:05,885 <5>Jan 17 20:52:05 ubnt kernel: eth0: Link down
2023-01-18T05:02:24,905 <5>Jan 17 21:02:24 ubnt kernel: eth0: Link down
2023-01-18T07:48:57,901 <5>Jan 17 23:48:57 ubnt kernel: eth0: Link down
2023-01-18T09:43:53,337 <5>Jan 18 01:43:53 ubnt kernel: eth0: Link down
2023-01-18T11:38:48,875 <5>Jan 18 03:38:48 ubnt kernel: eth0: Link down
2023-01-18T13:33:44,726 <5>Jan 18 05:33:44 ubnt kernel: eth0: Link down
2023-01-18T14:58:30,367 <5>Jan 18 06:58:30 ubnt kernel: eth0: Link down
2023-01-18T14:59:01,387 <5>Jan 18 06:59:01 ubnt kernel: eth0: Link down
2023-01-18T16:53:56,208 <5>Jan 18 08:53:56 ubnt kernel: eth0: Link down
2023-01-18T17:02:20,938 <5>Jan 18 09:02:20 ubnt kernel: eth0: Link down
2023-01-18T19:29:46,174 <5>Jan 18 11:29:46 ubnt kernel: eth0: Link down
2023-01-18T21:24:42,410 <5>Jan 18 13:24:42 ubnt kernel: eth0: Link down
2023-01-18T23:19:38,480 <5>Jan 18 15:19:38 ubnt kernel: eth0: Link down
2023-01-19T01:14:34,209 <5>Jan 18 17:14:34 ubnt kernel: eth0: Link down
2023-01-19T03:09:29,842 <5>Jan 18 19:09:29 ubnt kernel: eth0: Link down
2023-01-19T05:04:25,189 <5>Jan 18 21:04:25 ubnt kernel: eth0: Link down
2023-01-19T06:59:19,270 <5>Jan 18 22:59:19 ubnt kernel: eth0: Link down
2023-01-19T08:54:14,486 <5>Jan 19 00:54:14 ubnt kernel: eth0: Link down
2023-01-19T10:49:11,733 <5>Jan 19 02:49:11 ubnt kernel: eth0: Link down
2023-01-19T12:44:05,754 <5>Jan 19 04:44:05 ubnt kernel: eth0: Link down
2023-01-19T14:39:02,849 <5>Jan 19 06:39:02 ubnt kernel: eth0: Link down
2023-01-21T11:04:04,617 <5>Jan 21 03:04:04 ubnt kernel: eth0: Link down
2023-01-21T12:59:17,757 <5>Jan 21 04:59:17 ubnt kernel: eth0: Link down
2023-01-21T14:54:11,780 <5>Jan 21 06:54:11 ubnt kernel: eth0: Link down
2023-01-21T16:49:09,336 <5>Jan 21 08:49:09 ubnt kernel: eth0: Link down
2023-01-22T11:18:27,227 <5>Jan 22 03:18:27 ubnt kernel: eth0: Link down
2023-01-22T11:18:44,227 <5>Jan 22 03:18:44 ubnt kernel: eth0: Link down
2023-01-22T13:13:40,293 <5>Jan 22 05:13:40 ubnt kernel: eth0: Link down
2023-01-22T15:08:35,293 <5>Jan 22 07:08:35 ubnt kernel: eth0: Link down
2023-01-22T15:59:57,613 <5>Jan 22 07:59:57 ubnt kernel: eth0: Link down