MAC (Media Access Control) address or the hardware address is a 48-bit (12 hexadecimal) unique permanent address for each of the installed network interfaces in a system. There are tools that can temporarily change these addresses. In Linux Mint, there is a simple command-line utility to do so – macchanger.
To install it, open the Terminal and type in:
During installation, there is an option of automatically changing MAC addresses for interfaces once they are enabled/disabled. Select Yes to change automatically.
Once installed, macchanger can be used to randomize MAC addresses, set a unique address and so on. To get a list of available network interfaces and their MAC addresses from the Terminal, you can use the ip addr command.
Listing MAC address for an interface:
First, to display the current MAC address using macchanger, the command uses the -s parameter:
The current and permanent MAC addresses listed will initially be the same.
Setting a random MAC address:
Now, to change this to a random MAC address for the specific interface, the command uses the -r parameter:
The values of the permanent and the new MAC addresses will be different. In this example, as the permanent MAC address was changed directly to a random MAC address so both the current and permanent MAC addresses are shown as the same.
Suppose, if you are randomizing an already changed MAC address, then the output will show each of the addresses for current, permanent and the new addresses as different:
Restoring the default MAC address:
If you want to switch back to the original MAC address (the permanent address), use the -p parameter:
The permanent and the new MAC addresses now will be the same again.
Manually setting a MAC address:
Also, if you’d like to manually enter a MAC address on own, use the -m parameter:
This should be in the format of 6 octets like FF:FF:FF:FF:FF.
Getting vendor based MAC address details:
The format of a MAC address is such that the first three octets out of the six octets are OUI (Organizationally Unique Identifiers) that can identify the manufacturers of the network interface. To get a list of the OUIs, you can use the vendor list option -l :
This will display a list of the OUIs for different vendors.You can even filter the list using grep to display them from specific vendors:
To set a MAC address by a similar vendor, use the -a parameter:
Also, there is the -A parameter which uses a random vendor for setting the MAC address.
Finally, you can get a list of all the valid parameters that can be used with the -h parameter:
Also, there is the man page for it:
All done.