Spoof / Change mac address for NIC for Ubuntu

We can change the MAC address for NIC in Ubuntu easily as well. Just like we can do it in Linux (explained here)

You will need a package called macchanger installed on Ubuntu in order to change the MAC address for NIC.

Install macchanger

Install macchanger:

[[email protected] ~]$ sudo apt-get install macchanger

Verify the eth0 configuration using the ifconfig command

[email protected]:~$ ifconfig eth0

Output:

eth0      Link encap:Ethernet  HWaddr 00:0c:29:2d:a7:d5 
          inet addr:xxx.xxx.xxx.xxx  Bcast:xxx.xxx.xxx.xxx  Mask:255.255.255.0
          inet6 addr: fe80::21f:d0ff:fe44:7933/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2292995 errors:0 dropped:0 overruns:0 frame:0
          TX packets:541600 errors:0 dropped:50 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2346138833 (2.3 GB)  TX bytes:65315435 (65.3 MB)
          Interrupt:221 Base address:0x6000

So you can see that the current MAC address for eth0 is 00:0c:29:2d:a7:d5.

Spoof / Change / Modify MAC address on Ubuntu

In order to spoof / change / modify the MAC address for an interface we will have to shut down the network. The following is the command that will be used:

[email protected]:~$ sudo /etc/init.d/networking stop

Now using the macchanger command you can change the MAC address for eth0.

[email protected]:~$ sudo macchanger -a eth0

You will now have a new fake MAC address attached to the interface eth0.

There are several option for the command macchanger. The following are a few examples:

-a will assign random MAC address from the same vendor
-A will assign random MAC address from any vendor

For more details you can refer to the man page for macchanger.

3 Comments

  • Change MAC Address

    May 30, 2013 at 9:43 am Reply

    This is such a great post, and was thinking much the same myself. Another great update.

  • Mann

    July 16, 2013 at 7:26 am Reply

    Can you explain why do we get “Interrupt :221” ????

    I am getting the same message,and my internet is not working.

    • Gagan

      July 16, 2013 at 4:38 pm Reply

      Interrupt number has no direct relation with the working of your internet. It is the Interrupt number used by the network adapter. This number is assigned to the hardware by the kernel. You can find the complete list of interrupt numbers used by the kernel under /proc/interrupts.

Post a Comment

Time limit is exhausted. Please reload CAPTCHA.