Linux How To's | Bash Scripting | Python

Wednesday, 25 September 2013

Most of us are aware of the fact that, every Network Interface Card (NIC) in the world comes with a unique identity, given by its manufacturer, which is popularly known as "MAC Address" or "Ethernet Hardware address" or "Physical Address". These are 48-bits (12 hexadecimal digits) in length and stored in the hardware itself. Of these 48-bits, leftmost 24-bits (6 digits) are associated with the device manufacturer, called as Organizationally Unique Identifier (OUI), and the rightmost 24-bits represent the identification number of that device.

Even though MAC addresses are intended to reside permanently in the hardware being globally unique identification of the device,
it is very much possible to change the MAC address of these devices and this procedure is known as "MAC Spoofing". Well, MAC Spoofing has its own pros and cons. If it is used in network virtualization, it can also be used to exploit security vulnerabilities.

In this article, we will learn two ways with which we can change the MAC address of the network interface card. Here we go!

1. MAC Spoofing Using Graphical User Interface (GUI)

Step 1: Open Network Manager menu and select "Edit Connections".

Step 2: Select the Ethernet connection and click "Edit".

Step 3: Select the Wired/Ethernet tab, where you can see present MAC address of your NIC. Yes, it can be edited. Change it, save the settings, and restart the networking service.

2. MAC Spoofing Using Command Line Interface (CLI)

Step 1: Disable your interface using following command:

sudo ifconfig <interface> down

Replace the <interface> field with the appropriate name of the interface, for example eth0 or wlan0.

Step 2: Change the MAC address of the interface with the following command:

sudo ifconfig <interface> hw addr <new_MAC_address>

Just make sure that the new MAC address you will be entering is 12 digits in length with the format aa:bb:cc:dd:ee:ff.