In this article, you may learn, a way to amendment the mac address on UNIX system.
There are several reasons to vary the important or physical mac address of a Network Card in a very laptop. it’s going to be you don’t need to indicate the particular mac address to the general public network. Also, it’s going to be the rationale that your supervisor has been blocked the mac address within the router.
So, for the protection concern, it’s an honest apply to vary the particular mac address with the virtual one. This method is additionally referred to as Spoofing mac address.
In this article, a way to amendment the raincoat Address On UNIX system, i’m attending to state2alternative ways to vary it. thus let’s begin with the primary one.
Method I: Changing the MAC Address Using The Macchanger
Firstly, we are going to use the Macchanger package to change the real MAC address. Also, it is the easiest way to change the MAC address of any computer. So let’s start using this method.
Step 1: Find The MAC Address And Network Interface Of Your Computer
In the first step, you are going to find the MAC address of your computer and the Network Interface. So there is an easy command for that, you can find it below. Copy The Command
ip link show
As a result, you can see in the below picture. The network interface name is
eth0 and MAC address is
Step 2: Installing the Macchanger Package
In the second step, you are going to install this package. This package comes default in many Linux distros but if your operating system does not have it then you can install it. And also, you can just try to install it. If it will be there then you will get the message. So you can find useful the below command to install it on different Linux Distros.
If you want to install on Kali Linux, Ubuntu, Linux Mint, or on Debian or Debian-based Distro then you can use the below command.Copy The Command
sudo apt install macchanger
To install on RedHat, CentOS, Fedora, then you can use the below command.Copy The Command
sudo dnf install macchanger
Also, you can use the below command to install on Manjaro or Arch Linux.Copy The Command
sudo pacman -S macchanger
Note: You will get a prompt asking for a run automatically every time or not. So you can accept as per your choice.
Step 3: How To Change MAC Address Using Macchanger
If you want to change the MAC address then you must know your Network Interface Name. As we have checked in Step 1.
You can also try to get the detail about it using the help command
macchanger --help or detail manual using the command
If you want to assign a random MAC address then you can use the
-r switch. The command will look as below.Copy The Command
sudo macchanger -r eth0
For example, here,
eth0 is the Network Interface Name of my computer. So replace it with your computer Network Interface name.
Also, you can verify it using the below command, it will show you the spoofed MAC address.Copy The Command
ip a show
If you want to use a custom MAC address, For example
xx:xx:xx:xx:xx:xx then you can use the below command.Copy The Command
sudo macchanger --mac=xx:xx:xx:xx:xx:xx
Also, you can replace
xx:xx:xx:xx:xx:xx as per your custom MAC address.
Step 4: Reverting After Changing The MAC Address To Its Original MAC Address
But if you want to revert the MAC address to its original MAC address then you can use the below command.Copy The Command
sudo macchanger -p eth0
For example, change the
eth0with your network interface name.
Method II: Changing the MAC address using the iproute2
Secondly, it is another method to change the MAC address in Linux.
Step 1: Turn Off The Network Card
You have to turn off the network card. So you can use the below command useful for that.Copy The Command
sudo ip link set dev eth0 down
Note: replace the
eth0 with your network interface name.
Step 2: Setting New MAC Address
So now you have to set up the new MAC address using the following command.Copy The Command
sudo ip link set dev eth0 address xx:xx:xx:xx:xx:xx
Note: Replace here
eth0 with your network interface name and
xx:xx:xx:xx:xx:xx with your chosen MAC address.Copy The Command
sudo ip link set dev eth0 up
Step 3: Verifying The New MAC Address
Now, you can verify the new MAC address using the below command.Copy The Command
ip link show eth0
In this tutorial, you learned about How To Change MAC Addresses in Linux. As you can see it is very easy but if you get any problem you can ask me in the comment section.
You can also read about the below topics.