Friday 31 May 2013

Change mac address with macchanger Linux command

In some situations you need to fake / change / spoof a MAC address of your network interface. macchanger Linux command does this job in no time. With this tool you can change your mac address of any Ethernet network device wired or wireless.
Here is a small example:

My original mac address:
# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:16:d3:23:7c:f7
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Memory:ee000000-ee020000
Turn off your network interface:
# ifconfig eth0 down
Use macchanger to randomly generate new MAC address and assign it to eth0 network interface:
# macchanger -r eth0
Current MAC: 00:16:d3:23:7c:f7 (unknown)
Faked MAC:   32:cf:cb:6c:63:cd (unknown)
In case you see a following error message:
ERROR: Can't change MAC: interface up or not permission: Cannot assign requested address
Make sure that your interface is down and you are running macchanger as a root user.
Enable eth0 network interface and check new MAC address:
# ifconfig eth0 up
# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 32:cf:cb:6c:63:cd
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Memory:ee000000-ee020000
If for example a specific MAC address is required use macchanger as follows:
# macchanger -m b2:aa:0e:56:ed:f7 eth0
Current MAC: 32:cf:cb:6c:63:cd (unknown)
Faked MAC:   b2:aa:0e:56:ed:f7 (unknown)
macchanger also allows you to change mac address for a specific network card vendor. Use a -l option to print a list of all know network card vendors.

1 comment:

  1. I was trying to change my MAC Address but unable to do that as system shows error that you don't have permission to change your MAC Address . Thanks for providing me solution.

    Change Mac Address

    Thanks
    Silvester Norman

    ReplyDelete