intel_i225_v_ethernet_adapter_on_linux_fix.sh
· 944 B · Bash
Surowy
#!/usr/bin/env bash
# Prompt for network interface name
read -p "Enter network interface name: " INTERFACE
echo "Checking if 'ethtool' is installed"
if ! command -v ethtool &> /dev/null; then
echo "Installing ethtool..."
dnf install -y ethtool
fi
echo "Disabling Energy Efficient Ethernet (EEE)"
ethtool --set-eee $INTERFACE eee off
echo "Setting Speed & Duplex to Auto-Negotiation"
ethtool -s $INTERFACE speed 1000 duplex full autoneg on
echo "Disabling Power Saving Mode for PCI"
if [ -d "/sys/class/net/$INTERFACE/device/power/control" ]; then
echo "on" > /sys/class/net/$INTERFACE/device/power/control
fi
echo "Disabling Wake-on-LAN (WoL)"
ethtool -s $INTERFACE wol d
echo "Disabling Low Power Mode and Large Send Offload (LSO)"
ethtool -K $INTERFACE gso off gro off tso off
ethtool -K $INTERFACE lro off
echo "Current settings for interface $INTERFACE"
ethtool $INTERFACE
ethtool -k $INTERFACE
echo "Configuration completed"
| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # Prompt for network interface name |
| 4 | read -p "Enter network interface name: " INTERFACE |
| 5 | |
| 6 | echo "Checking if 'ethtool' is installed" |
| 7 | if ! command -v ethtool &> /dev/null; then |
| 8 | echo "Installing ethtool..." |
| 9 | dnf install -y ethtool |
| 10 | fi |
| 11 | |
| 12 | echo "Disabling Energy Efficient Ethernet (EEE)" |
| 13 | ethtool --set-eee $INTERFACE eee off |
| 14 | |
| 15 | echo "Setting Speed & Duplex to Auto-Negotiation" |
| 16 | ethtool -s $INTERFACE speed 1000 duplex full autoneg on |
| 17 | |
| 18 | echo "Disabling Power Saving Mode for PCI" |
| 19 | if [ -d "/sys/class/net/$INTERFACE/device/power/control" ]; then |
| 20 | echo "on" > /sys/class/net/$INTERFACE/device/power/control |
| 21 | fi |
| 22 | |
| 23 | echo "Disabling Wake-on-LAN (WoL)" |
| 24 | ethtool -s $INTERFACE wol d |
| 25 | |
| 26 | echo "Disabling Low Power Mode and Large Send Offload (LSO)" |
| 27 | ethtool -K $INTERFACE gso off gro off tso off |
| 28 | ethtool -K $INTERFACE lro off |
| 29 | |
| 30 | echo "Current settings for interface $INTERFACE" |
| 31 | ethtool $INTERFACE |
| 32 | ethtool -k $INTERFACE |
| 33 | |
| 34 | echo "Configuration completed" |