No commit activity in last 3 years
No release in over 3 years
An implementation of class for MAC address (i.e. IEEE EUI48 identifiers).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.10
~> 10.0
 Project Readme

MacAddressEui48

This is an implementation of MAC address along with tools for OUI lookup and random MAC address generation. It can be used as a Ruby library or through the command line tools.

The OUI resolver is based on the official OUI file provided by the IEEE http://standards-oui.ieee.org/oui.txt. This file is stored in data/.

Features

Command line tools

  • gen_mac_address.rb: generate random MAC address
    • Fully random address
    • Generate multiple address at one time
    • Address with registered OUI
    • Address with given OUI
  • oui_lookup.rb: resolve OUI of MAC address

Library

  • MacAddressEui48::MacAddress

    • Initialization from Integer, String of MacAddress
    • Comparison operator
    • Iteration over a range of MacAddress
    • Test for Broadcast address
    • Flag tests: locally administered, multicast, ...
  • MacAddressEui48::OuiResolver

    • Lookup: Organization/Vendor from MAC address
    • Reverse lookup: OUI (MAC prefix) from Organization/Vendor
    • Random MAC address generation
      • Over all space (2^48 values)
      • Only within space of registered OUI
      • Over a specific OUI

Installation

gem install mac_address_eui48

Usage

Command line tools

Generation of random MAC address

# fully random address
$ ./gen_mac_address.rb 
5A:79:5A:7D:FC:71

# random address in with registered OUI
$ ./gen_mac_address.rb -r
00:1C:AE:57:0E:BA

# multiple address
$ ./gen_mac_address.rb -n 5
3F:40:DC:4B:CC:EB
49:23:BC:D4:54:9D
85:F6:49:BB:CC:47
33:68:8A:9E:21:57
42:B6:80:B8:B0:7F

# random mac address from a given OUI (vendor)
$ ./gen_mac_address.rb -o "Xerox Corporation"
9C:93:4E:27:2A:16

Resolving OUI

$ ./oui_lookup.rb C4:04:15:12:34:56
NETGEAR INC.,

Library

TODO

Development

TODO

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/cunchem/mac_address_eui48. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.