How to change Mac Address of Network Interface in Linux

Hi everybody, this article is about how we can change Mac Address also known as Physical Address in GNU/Linux Operating System which includes any Linux Distributions like Debian, Fedora, CentOS, Mint, Ubuntu, Arch linux and many more. So, first we’ll learn about what really is a Mac Address or Physical Address.

Mac Address (media access control address) is a unique identifier assigned to network interfaces for communications on the physical network segments, mostly adapter and interface cards, an apparently ideal solution for securing networks. And changing the MAC address of a machine is called spoofing a MAC address or faking a MAC address.

Reasons to change or spoof Mac Address of a Linux Machine

These are the major reasons why one changes the MAC address of their machine.

  • For privacy for instance when connecting to a Wi-Fi hotspot.
  • To gain a new IP Address.
  • To gain access to a Mac Address Binded Network or Router.
  • To stay protected from Hackers.

Here’s a quick and easy steps on how to change the Mac Address of a Network Interface in Linux Operating System.

1. Finding the Physical Mac Address

First of all, we’ll need to find the physical address of our machine using a tool which is preinstalled in all Linux Distributions available these days called ifconfig. To do so, run the following command in a shell or a terminal.

$ifconfig -a | grep HWaddr

Now, here is the list of interfaces connected to our Linux box. Here, we have ethx and wlanx where ethx are the ethernet NICs whereas wlanx are the Wireless NICs and x is the device number allocated by the system to indentify.

 2. Spoofing Mac Address in Linux

Now, as we can see the connected NICs from above step, we’ll want to change the Mac Address of that interface as we desire. Here, in this article, we’ll gonna change the Mac Address “0e:02:27:52:75:50” of our wireless interface named wlan2 to “0e:02:27:52:75:51”. So, we’ll need to switch to root mode so that we have sudo access.

$ sudo -s

After switching, we’ll need to run the following commands.

# ifconfig wlan2 down
# ifconfig wlan2 hw ether 0e:02:27:52:75:51
# ifconfig wlan2 up
# ifconfig wlan2 |grep HWaddr


Note: Please change the above address ie e8:de:27:12:75:51 to the desired address you want to spoof and wlan0 to the interface name you wanna change the Mac Address .


Thats all, we have successfully changed Mac Address of a Network Interface in Linux Operating System using ifconfig. Changing Physical Address adds an extra security layer on top of the interface and the network. Process of changing a mac address is also known as spoofing. So, if you have any queries, suggestions, comments, please do comment below so that we can improve our contents and website. Thanks!

Read More: “How to Get Google AdSense Approval in 2018”

1 thought on “How to change Mac Address of Network Interface in Linux”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.