Wan interface goes up and down periodically
My R7800 which is my main router has been running for months without a hiccup running on 23.05.5 but 23.05 is slowly coming to an end so I started to test 24.10.2
Everything is working great except for one annoying problem.
The wan interface periodically restarts, I did not notice it in daily usage as the restarts, usually two or three times, happened during the night or in periods we were not at home.
After some searching I identified a couple of possible causes.
1. Cable or ethernet socket problem, to be sure I changed the cable and inspected the sockets everything looked good and this did not help.
2. Not using bridge vlans, version 24.10 changed to DSA which needs bridged vlans in case of multiple interfaces with ports (the qca8k DSA driver seems not error free, I do have several interfaces for guest, IoT etc. but these are for wireless only so I am not using bridge vlans and I do not think this is necessary.
3. Enabled EEE, Energy Efficient Ethernet can switch an ethernet interface to low power mode when traffic is low.
This seems to be the most likely cause as it happened during periods of low traffic, so I started to look into this.
To see if EEE is enabled on your router you need to install ethtool:
opkg update && opkg install ethtool or apk update && apk add ethtool if you have main builds with apk
Normally the log will show the interface name which restarts but if you want to check what is your wan interface, you can do from command line: ifconfig.
For me it is just wan so I check with
ethtool –show-eee wan
For me it was enabled
Disable EEE with:
ethtool --set-eee wan eee off
Check again and it shows disabled:
root@R7800-1:~# ethtool --show-eee wan
EEE settings for wan:
EEE status: disabled
Tx LPI: disabled
Supported EEE link modes: 100baseT/Full
1000baseT/Full
Advertised EEE link modes: Not reported
Link partner advertised EEE link modes: 100baseT/Full
1000baseT/Full
After a reboot EEE is automatically enabled again so add that command to startup:
/etc/rc/local:
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
# ethtool --show-eee wan
ethtool --set-eee wan eee off
exit 0
There is a config option in /etc/network/config: enable_eee so I tried this:
config device 'wan'
option name 'wan'
option enable_eee '0'
But it resulted in a wan interface which did no longer pass traffic so need to research further
Long story short disabling EEE on the wan interface stopped my periodically restarting wan interface during periods of low traffic.
