Skip to content

Instantly share code, notes, and snippets.

@questionlp
Created June 14, 2022 04:14
Show Gist options
  • Save questionlp/cd008968b928c68bebc4b40505589e3e to your computer and use it in GitHub Desktop.
Save questionlp/cd008968b928c68bebc4b40505589e3e to your computer and use it in GitHub Desktop.
Generate Random MAC Address Shell Script
#!/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