Created
June 14, 2022 04:14
-
-
Save questionlp/cd008968b928c68bebc4b40505589e3e to your computer and use it in GitHub Desktop.
Generate Random MAC Address Shell Script
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 | |
echo "$(printf "%012X" $(( 0x$(hexdump -n6 -e '/1 "%02X"' /dev/random) & 0xFEFFFFFFFFFF | 0x020000000000 )) | sed 's/.\{2\}/&:/g' | sed s/:$//g)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment