I'm still using this, haven't had an issue since. (Nov 2025)Using the documented workarounds my test box has been up for 21 days with no network drops.
In /etc/networks/interfaces:
Code:iface eno2 inet manual post-up ethtool -K eno2 tso off gso off
I'm running the latest 9.2.11 (kernel 7.0.14-8-pve) and the issue still present.Have someone upgraded to a new version? Id like to know if this has been solved or not
Install ethtool
apt install ethtool
replace aaa.bbb.ccc.ddd with router's IP address
Save it to a file, e.g., /usr/local/bin/network_watchdog.sh
Make it executable
chmod +x /usr/local/bin/network_watchdog.sh
run:
crontab -e
Add the line:
*/5 * * * * /usr/local/bin/network_watchdog.sh
NOTE: no need for restart, crontab picks up the new config automatically
Driver detection TEST:
ethtool -i $(for i in /sys/class/net/*/; do i=$(basename "$i"); [[ "$(ethtool -i "$i" 2>/dev/null | awk '/^driver:/{print $2}')" == "e1000e" ]] && echo "$i" && break; done)
=======================================================
#!/bin/bash
TARGET_IP="aaa.bbb.ccc.ddd"
DRIVER="e1000e"
myDateFile="/tmp/network_watchdog_date"
lockFile="/tmp/network_watchdog.lock"
logFile="/var/log/check_network.log"
exec 9>"$lockFile"
/usr/bin/flock -n 9 || exit 0
IFACE=$(for i in /sys/class/net/*/; do
i=$(basename "$i")
[[ "$(/usr/sbin/ethtool -i "$i" 2>/dev/null | /usr/bin/awk '/^driver:/{print $2}')" == "$DRIVER" ]] && echo "$i" && break
done)
ret=$(/usr/bin/ping -c3 -W2 -q $TARGET_IP >/dev/null; /usr/bin/echo $?)
if [[ "0" != "$ret" ]]; then
sleep 30
ret=$(/usr/bin/ping -c3 -W2 -q $TARGET_IP >/dev/null; /usr/bin/echo $?)
fi
if [[ "0" != "$ret" ]]; then
curDate=$(/usr/bin/date +"%d.%m.%Y %H:%M")
if [[ ! -f $myDateFile ]]; then
echo "$curDate" > $myDateFile
echo "$curDate: Fault detected on $IFACE, restarting networking" >>$logFile
/usr/bin/systemctl restart networking
else
echo "$curDate: Fault persists on $IFACE, reloading $DRIVER driver" >>$logFile
/usr/sbin/rmmod $DRIVER
sleep 2
/usr/sbin/modprobe $DRIVER
sleep 5
/usr/bin/systemctl restart networking
fi
else
if [[ -f $myDateFile ]]; then
myDate=$(cat $myDateFile)
curDate=$(/usr/bin/date +"%d.%m.%Y %H:%M")
echo "$curDate: Recovered from fault detected on $myDate" >>$logFile
rm -f $myDateFile
fi
fi
=======================================================
We use essential cookies to make this site work, and optional cookies to enhance your experience.