Created
March 1, 2022 19:34
-
-
Save netaviator/02d66ffc6294cb6cca52b3b2ef88be99 to your computer and use it in GitHub Desktop.
Bash script to disable lldp and enable link-state on intel nics.
This file contains hidden or 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 | |
echo "Write special configurations onto Intel NICs." | |
echo "Search for ensXfX devices and apply settings..." | |
for iface in $(ip link list | cut -d ' ' -f2 | tr ':' '\n' | awk NF) | |
do | |
if [[ "$iface" =~ ^ens[0-9]f[0-9]$ ]]; then | |
echo $iface | |
echo "Disable LLDP..." | |
/usr/sbin/ethtool --set-priv-flags $iface disable-fw-lldp on | |
echo "Enable link down on close..." | |
/usr/sbin/ethtool --set-priv-flags $iface link-down-on-close on | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment