Macchanger, change the MAC address of network devices

about macchanger

In the next article we are going to take a look at Macchanger. This is a free and open source utility, which is available for Gnu / Linux systems. With her we will be able to see and change the MAC address, from the terminal, of any network device on our computer.

For those who are not familiar with what the MAC address (Media Access Control), tell him that this is the unique 48-bit identifier assigned by the manufacturer to a piece of network hardware. It is also known as a physical address, and it is unique for each device. This address can be used by some services in order to limit access.

Change MAC address of network devices in Ubuntu using Macchanger

This tool will offer us different possibilities to change or view the MAC address of our equipment.

Install Macchanger

First of all, the first thing will be install this utility on our system. In Ubuntu we will only have to open a terminal (Ctrl + Alt + T) and execute the command in it:

install macchanger terminal

sudo apt install macchanger

During the installation, we will see a dialog box that it will ask us if we want the MAC address to be changed automatically. Here we can choose either of the two options. Although as you can see in the following screenshot, for this example I chose the “Yes”.

install macchanger

List all network interfaces

Once installed, we are going to start with list all network interfaces so that we can choose the one whose MAC address we want to change. To show all these network interfaces, in a terminal (Ctrl + Alt + T) we will only need to write:

list network interfaces

ip addr

As you can see in the previous screenshot, this command has listed all the network interfaces of the system, along with their relevant information. For this example, we are going to change the MAC address of the network interface enp0s3.

Verify the current MAC address of a specific network interface

Before changing the MAC address, let’s start with verify the current MAC address of the network interface that interests us. We will achieve this with the command:

currente mac

macchanger -s enp0s3

In this command, each user must replace the interface name enp0s3 with the name of the interface on which they want to work.

Randomly change the MAC address of a specific network interface

Arrived this far, we will assign a random MAC address to the network interface we are interested in. We will do this with the command:

change mac randomly

sudo macchanger -r enp0s3

Here, as with all the examples that we are going to see, each user must change the name of the network interface that interests them. After executing this command, we can confirm that the MAC address of the network interface has been changed with the help of the command used in the previous point, as can be seen in the screenshot.

Manually changing the MAC address of a network interface

Another possibility that this utility offers us is that of manually assign a MAC address of your choice to the network interface. For this, we can use the command:

change mac manually

sudo macchanger --mac=a2:42:b0:20:ee:03 enp0s3

In this command, we will be able to use any MAC address of our choice, as long as it is in the correct format.

We can confirm that the MAC address of the specified network interface has been changed with the help of the command:

macchanger -s enp0s3

Restore the real MAC address of a specific network interface

To finish we will restore the original MAC address of the network interface we specified using:

return permanent mac

sudo macchanger –p enp0s3

When we run this command, We will see that the permanent and new MAC address of the specified network interface are the same. This means that the original MAC address of the network interface has been successfully restored.

Help

If we want consult all the possible options for the manipulation of MAC addresses in our equipment, we will only have to use the terminal (Ctrl + Alt + T) command:

Macchanger help

macchanger --help

Uninstall

Remove this program from Ubuntu, it is as simple as installing it. It is only necessary to open a terminal (Ctrl + Alt + T) and execute in it:

uninstall Macchanger

sudo apt remove macchanger

As we have just seen, you can easily install the Macchanger utility on your Ubuntu 20.04 system, then use it to view and change the MAC address of any network device.

Add Comment