Created
July 20, 2022 21:57
-
-
Save akhepcat/8d6c5bafb832ee2df036bc5746b412d1 to your computer and use it in GitHub Desktop.
quick network interface renegotiation script and helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install in /etc/systemd/system | |
# enable as '[email protected]' or other interface(s) | |
# | |
[Unit] | |
Description=ethtool configuration to enable 2500mbps speed for the specified card | |
After=network-online.target | |
Wants=network-online.target | |
[Service] | |
ExecStart=/usr/local/sbin/renegotiate-eth %i | |
Type=oneshot | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# put this in /usr/local/sbin | |
# make sure ethtool is installed and in the basic path | |
if [ -n "$1" ] | |
then | |
ethtool -s "$1" autoneg off | |
ethtool -s "$1" autoneg on | |
# ethtool --negotiate "$1" | |
ethtool "$1" | grep Speed | |
else | |
echo "which interface?" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment