Skip to main content

Generating a random MAC address

# enum -r -s ':' -f '%02x' 0 .. 6x .. 255
f3:1c:51:29:9a:ed
  • 0 .. 6x .. 255 — produce values between 0 and 255 (inclusively), 6 of them
  • -r — produce random values
  • -s ':' — insert a colon between values (instead of a newline)
  • -f '%02x' — formats values as two-digit hex values

enum is available in at least Debian, Fedora and Gentoo (package app-misc/enum).