-
-
Save qgp9/0d77ce769c03e2d313d72fa1b6582555 to your computer and use it in GitHub Desktop.
Fix a mac address using nmcli for some SBCs
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/sh | |
DEVICE=end0 | |
MAC="26:6E:FE:5C:CE:38" # prefered mac address | |
UUID=$(nmcli -f UUID,DEVICE connection show | awk -v dev=$DEVICE '$2==dev{print $1}') | |
nmcli connection down $UUID | |
nmcli connection modify $UUID ethernet.cloned-mac-address "$MAC" | |
nmcli connection up $UUID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment