PHPackages                             kapilsangoma/mac-address - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kapilsangoma/mac-address

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kapilsangoma/mac-address
========================

Forked from blake-gardner/mac-address. Get, validate and generate MAC addresses.

v3.1(4y ago)04MITPHPPHP &gt;=5.3.2

Since May 19Pushed 4y agoCompare

[ Source](https://github.com/kapilsangoma/php-mac-address)[ Packagist](https://packagist.org/packages/kapilsangoma/mac-address)[ RSS](/packages/kapilsangoma-mac-address/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (9)Used By (0)

PHP MAC Address
===============

[](#php-mac-address)

This is a PHP class for MAC address manipulation on top of Unix, Linux and Mac OS X operating systems. it was primarily written to help with spoofing for wireless security audits.

Capabilities
------------

[](#capabilities)

- Verify you are executing it from the command line
- Verify you are running the script as an administrator
- Generate new random MAC addresses
- Validate MAC addresses
- Get the current system’s MAC address
- Set or “spoof” any MAC address you want

Usage
-----

[](#usage)

```
// require the class
require_once './src/BlakeGardner/MacAddress.php';

// import the class
use BlakeGardner\MacAddress;

// get the mac address of the eth0 interface
var_dump(MacAddress::getCurrentMacAddress('eth0'));

// generate a random mac address
var_dump(MacAddress::generateMacAddress());

// validate an MAC address
var_dump(MacAddress::validateMacAddress('00-B0-D0-86-BB-F7'));

// set a randomly generated MAC address on the eth0 interface
var_dump(MacAddress::setFakeMacAddress('eth0'));

// set a specific MAC address on the eth0 interface
var_dump(MacAddress::setFakeMacAddress('eth0', '00:E4:01:2C:79:DA'));

// get the mac address of the eth0 interface using the ifconfig path that we define
var_dump(MacAddress::getCurrentMacAddress('eth0', '/usr/local/sbin/ifconfig'));
echo "\n";
```

For more see the example.php file. You can run the example on the command line as root. `php example.php`

Planned Features
----------------

[](#planned-features)

- List all interfaces on the system
- OS detection
- Suppress errors on the command line

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~630 days

Recently: every ~787 days

Total

6

Last Release

1642d ago

Major Versions

2.1.4 → v3.02022-01-03

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16011413?v=4)[kapilsangoma](/maintainers/kapilsangoma)[@kapilsangoma](https://github.com/kapilsangoma)

---

Top Contributors

[![kapilgupta01](https://avatars.githubusercontent.com/u/131970355?v=4)](https://github.com/kapilgupta01 "kapilgupta01 (2 commits)")[![BlakeGardner](https://avatars.githubusercontent.com/u/810889?v=4)](https://github.com/BlakeGardner "BlakeGardner (1 commits)")[![vsc55](https://avatars.githubusercontent.com/u/13438676?v=4)](https://github.com/vsc55 "vsc55 (1 commits)")

---

Tags

addressIPMACifconfigDHCP

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/kapilsangoma-mac-address/health.svg)

```
[![Health](https://phpackages.com/badges/kapilsangoma-mac-address/health.svg)](https://phpackages.com/packages/kapilsangoma-mac-address)
```

###  Alternatives

[mlocati/ip-lib

Handle IPv4, IPv6 addresses and ranges

3167.3M67](/packages/mlocati-ip-lib)[markrogoyski/ipv4-subnet-calculator

Network calculator for subnet mask and other classless (CIDR) network information.

175852.6k14](/packages/markrogoyski-ipv4-subnet-calculator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
