Generates random MAC addresses, e.g. for virtual machines, containers or
tests. By default they are locally administered unicast addresses, so they
never clash with addresses assigned by the IEEE to manufacturers. Uses R's
random number generator, so results can be reproduced with set.seed().
Arguments
- n
Number of addresses.
- local
Logical. Set the locally administered bit (see
is_local_MAC())? IfFALSE, the bit is cleared.- multicast
Logical. Set the multicast bit (see
is_multicast_MAC())?- sep
Separator to use, as in
normalize_MAC().
Examples
set.seed(1)
random_MAC(3)
#> [1] "FA:80:D6:D1:E0:69" "42:A1:2A:BA:54:B5" "A6:FC:0D:32:14:ED"
random_MAC(1, sep = "-")
#> [1] "4A-06-48-4E-D4-24"