mirror of
https://gitee.com/callmer/pve_toss_notes.git
synced 2026-08-31 22:12:51 +08:00
29 lines
755 B
Bash
29 lines
755 B
Bash
#!/bin/sh
|
|
|
|
ETHTOOL_PATH=$(command -v ethtool)
|
|
|
|
if [ -z "$ETHTOOL_PATH" ]; then
|
|
echo "Error: ethtool command not found. Please install ethtool."
|
|
exit 1
|
|
fi
|
|
|
|
NETDEV=$(ip route show default | awk '{for (i=1; i<=NF; i++) {if ($i == "dev") {print $(i+1); exit;}}}')
|
|
|
|
if [ -z "$NETDEV" ]; then
|
|
echo "Error: Could not determine default network device using 'ip route show default'."
|
|
exit 1
|
|
fi
|
|
|
|
echo "Configuring network device $NETDEV using $ETHTOOL_PATH for Tailscale optimizations..."
|
|
|
|
"$ETHTOOL_PATH" -K "$NETDEV" rx-udp-gro-forwarding on rx-gro-list off
|
|
|
|
if [ "$?" -eq 0 ]; then
|
|
echo "Configuration successful for $NETDEV."
|
|
exit 0
|
|
else
|
|
echo "Error: ethtool configuration failed. Check permissions or device status."
|
|
exit 1
|
|
fi
|
|
|