September 14, 2005

How to change the MAC address of your machine

In linux, you can change the hardware (MAC) address of your machine.This is how it is done.

# ifconfig eth0 down
# ifconfig eth0 hw ether 00:80:48:BA:d1:20
# ifconfig eth0 up
# ifconfig eth0 |grep HWaddr


Why would I want to change the MAC address of my machine - you ask ?
Consider this scenario. I am connected to the internet using a cable modem. And my ISP dynamically allocates the IP address to my machine. But they also store the MAC address of my ethernet card and associate it with the IP address they provide. Suppose I change my network card (or my machine), I will not be able to log on to the net because my ethernet card has a different MAC address than the one stored in the database of the ISP.
The immediate short fall of this is that, I have to contact my ISP through telephone and request them to reset the MAC address table (or what ever) in their database to point to my new MAC address. So if I knew my old MAC address, I could easily fool the ISP to think that I am using the original machine by setting the MAC address of my new machine to the old value. And I could save myself a telephone call.

Related Posts :
How to install network card in Linux
How to assign an IP address
Setting up multiple IP addresses on a single NIC
Related Content


7 comments:

Anonymous said...

Thank you very much for this tip, I had a situation this year exactly like you described - computer went down and to connect the new one I had to figure out how to change the MAC address to instantly connect to the net since new computer was temporary solution and it was out of working hours to call support. Ok, it was windows machine but the situation remains.

Good blog, I check it on a regular basis.

Anonymous said...

Yes, good blog. :-)

Anonymous said...

Also worth commenting, a lot of providers such as Comcast and Charter Cable in Michigan auto-update your computer's MAC address. All you need to do is power-cycle (unplug/wait 15 seconds/plug back in) your cablemodem so it restarts and learns your new computer MAC - and everything starts working like magic.

The only downside to this method is that you lose your IP address that was previously assigned. If you're using dyndns.org or other domain-forward services though this isn't a big deal.

Skuzz

Anonymous said...

This assume that the ethernet interface has the appropriate commands to change the mac address. Not all do.

Anonymous said...

Another scenario. Hosted server at the isp, which goes bad on sunday morning (of course sunday! machines don't consider having a bad day on weekdays). Since my ISP uses port-security, and humans don't work on sundays, i have to fake the new server's MAC. Otherwise i won't be able to use it until Monday morning.

Anonymous said...

thank you very much. I am using cable modem and i need to change mac id in linux. There is many software to change mac id in Windows but it is pretty hard to find something like that for linux.

beemused said...

out of the 3 sites I looked at from my web search, yours had the clearest and most precise intructions. thanks for sharing!

Get Posts via email