Fork me on GitHub

Project Notes

Generating Random MAC Addresses

Delving into MAC addresses and a little script to generate random ones.


This is a quick ruby port of the python/random_mac_generation example. See there for notes on MAC addresses and such.

A Little Random MAC Generator

random_mac.rb generates a random MAC using the Xensource, Inc. OUI by default unless you pass it to a specific OUI on the command line:

$ ruby test_random_mac.rb
Run options: --seed 15492

# Running:


Finished in 0.001304s, 3067.4847 runs/s, 3834.3558 assertions/s.

4 runs, 5 assertions, 0 failures, 0 errors, 0 skips

$ ruby random_mac.rb
$ ruby random_mac.rb 11-22-33

Credits and References

About LCK#65 ruby
Project Source on GitHub Return to the Project Catalog

This page is a web-friendly rendering of my project notes shared in the LittleCodingKata GitHub repository.

LittleCodingKata is my collection of programming exercises, research and code toys broadly spanning things that relate to programming and software development (languages, frameworks and tools).

These range from the trivial to the complex and serious. Many are inspired by existing work and I'll note credits and references where applicable. The focus is quite scattered, as I variously work on things new and important in the moment, or go back to revisit things from the past.

This is primarily a personal collection for my own edification and learning, but anyone who stumbles by is welcome to borrow, steal or reference the work here. And if you spot errors or issues I'd really appreciate some feedback - create an issue, send me an email or even send a pull-request.