Skip to content
/ chmac Public

Bash tool for changing the MAC address of a network device

License

Notifications You must be signed in to change notification settings

stephica/chmac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chmac

Description

chmac is a command-line tool for changing the MAC address of a network device.

Features

  • Supports both eth and wlan 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.)

Download

https://github.com/0mid/chmac

Setup

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}

Usage

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.

About

Bash tool for changing the MAC address of a network device

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages