chmac
is a command-line tool for changing the MAC address of a
network device.
- Supports both
eth
andwlan
devices (i.e., wired and wireless network devices). - Follows IEEE 802 standard for a MAC address (LSB of left-most byte must be zero) so that a valid MAC is generated in one pass.
- Does a check on the new MAC address before releasing its associated device to make sure the changed MAC address is in effect.
- Keeps a history of previous MAC addresses in case one needs to revert to a particular MAC in the future.
- Optionally, updates the relevant Network Manager system connections file with the changed MAC address so that the change is preserved in case the connection is reset. Also optionally, disables auto connect to make sure, upon next connection to the same access point, no connection is established before a desired MAC address is set. (This feature works only if you use Network Manager to manage your network connections.)
Clone the repository for this project and make sure the scripts are executable.
mkdir ~/bin && cd bin
git clone https://github.com/0mid/chmac.git
chmod u+x ~/bin/chmac/{chmac.sh,chkeyval.sh,lscmdoutput.sh}
Invoke chmac.sh
as root. Remember that, if it’s functioning
sanely, sudo
sanitizes the $PATH
environment variable, so if
you use sudo
, you need to provide the full path to where you put
chmac.sh
, e.g.
sudo ~/bin/chmac/chmac.sh
even if ~/bin/chmac
is on your $PATH
.