Periodically loosing internet connection on all devices (wired and wireless)

I have OpenWrt 19.07.2 installed on Linksys WRT1900ACS. Periodically (mostly randomly, once in few days or more often) it loses internet (WAN) connection for all devices, wireless and wired. Based on the logs, that happens after or around this event: "netifd: wan (3898): udhcpc: sending renew to (ip address)"
Rebooting the router or restarting WAN interface restores the connection.

Any ideas on how to resolve this issue?
Thank you!

1 Like

@asicfan, welcome to the community!

First...

Please confirm it this is or is not happening at the end of your ISP's lease?

Are you loosing IPv4, IPv6 connectivity - or both?

Thank you for your reply. How do I check ISP lease time?

I have only IPv4, I don't use IPv6. I have WAN6 disabled.

2 Likes

Did you replace dnsmasq?

I don't think so.

2 Likes

Disable IPv6 Completely

  1. Check the value of the parameter "disable_ipv6" using the command below and replace the parameters in step two with those of your router and add a "=1" at the end:
    sysctl -a 2>&1 | grep disable_ipv6

  2. Replace the parameters "disable_ipv6" and after paste the commands at the same time in PuTTY:

sed -i -e "/^[^#]*$/d" /etc/sysctl.conf
cat << EOF >> /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.br-lan.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.eth0.disable_ipv6=1
net.ipv6.conf.eth0.1.disable_ipv6=1
net.ipv6.conf.eth0.2.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1
EOF
sysctl -p

  1. Paste these commands at the same time in PuTTY:
sed -i -e "/^[^#]*$/d" /etc/rc.local
cat << EOF >> /etc/rc.local

sysctl -p

exit 0
EOF

  1. Check if IPv6 is disabled with these commands, "disable_ipv6" should show at the end this "=1" and when you use the command "ip a" don't have to show "inet6":
sysctl -a 2>&1 | grep disable_ipv6

ip a | grep inet6

This does not solve anything but it is good to know.

1 Like

Check the system logs to make sure your not running out of memory..

e.g.
dnsmasq invoked oom-killer:

If that one shows up in particular, everything will stop while the system cleans up and restarts dnsmasq (which would also then resolicit DHCP requests)

Edit: Would also account to not seeing the uptime reset, because the router doesn't reboot.. It just locks up until it's done (including SSH connections)..

If you're running Adblock, reduce the blocklist sources (guess how I found out :smile:)

1 Like

What I noticed, when disconnection happens and I try to login to LUci, it works really slow. It logs me in, but moving around between options is much slower than usual.

Don't see this in the logs.

Write in PuTTY:
top

1 Like

Thanks, got it done. Will see if this solves the issue.

Should I run it when disconnect happens?

When this happens.

2 Likes

So, I lost internet overnight again. Checked memory - ok, CPU load - ok, nothing seems to be out of the ordinary. What interesting, system log does not have "netifd: wan (3898): udhcpc: sending renew" event anymore. Now it looks like I'm losing internet every 12 hours or so. Can it be related to the lease time? How can I check?

Try enabling STP.

Network -> Interfaces -> LAN (Click Edit) -> Physical Settings

Reboot.

Thanks for the suggestion! Just wonder, why would STP make a difference here?
I thought it's more to improve routing on the LAN side, or I'm missing something?

The truth is I don't know why that happens, the only thing I think is that the ISP changes your IP address and OpenWrt does not detect that there is no internet traffic and does not try to auto restart the WAN Interface to use that new IP address or not try restores the connection and you have to do it manually.

Try this maybe it will help you.

  1. Change the Ethernet Cable.

  2. Change the Power Supply of your Modem and Router.

  3. Install the latest official version 19.07.3 or Davidc502 version and you do a Factory Reset through PuTTY.

Paste them one by one:

firstboot -y
umount /overlay
jffs2reset -y

firstboot && reboot now

# Optional
mtd -r erase rootfs_data
 

That sounds similar to an issue that I have been having where the router stops communicating with the modem except for a very small trickle of data and I can resolve it by unplugging the Ethernet cable from the modem and plugging it back in. I have also noticed that when I log into Luci with no internet the system time on the router is way off by like a day or two.
Does this sound familiar at all to you?
openwrt.org/t/replug-ethernet-everyday/55686/2

Yes, definitely my router looses connection with cable modem. I also see small trickle of data between them, but can't access Internet. I have not noticed time change, though, so will specifically look at that next time it happens. I usually restart WAN interface on my router instead of unplugging Ethernet cable.
So far I have tried upgrading to the latest image, which did not help. Now I'm running Davidc502 image with default configuration. Have not touched any settings, will see how this works.
I had stock and DD-WRT firmware on this router before and have not had any issues with disconnect. It only happened when I've switched to OpenWrt recently.
I also have Netgear WiFi extender running OpenWrt in dummy AP mode, which is connected to my router via LAN. I wonder if that may cause any issues..

Given this, I would suspect that the data you're seeing between the cable modem and your router is DHCP client requests (router side) and/or ARP between the two devices.

You never did check this (or if you did, I must have missed it in the thread):

What do you see on the output of the following command (redact your IP address, or at least part of it):
logread | grep udhcpc

At the moment don't see anything after I run this command.
I don't think the disconnect happened at the end of the lease, since WAN stats show there still several hours bore current lease expires. Also, I had disconnects happening within 20-30 min from eachother.