Faking MAC Address in Linux

I’m house-sitting for my brother, and I brought my computer over so I didn’t die of boredom, alone, in a house for a week. The problem is the Internet over here is hooked up directly to the modem, and the Internet provider will only provide an Internet address (IP address) to the ethernet card that was registered to them: the one in my brother’s computer. So, I turned on the computer, checked out the advanced properties of the ethernet card to get the MAC (physical) address and wrote it down. In Linux, using ifconfig, you can tell a particular interface to pretend its address is something else. If you’re using a Debian derivative (I’m using Ubuntu), you’ll probably need sudo before the command.

Note: Copy your current MAC address and put it somewhere safe, just in case – I haven’t tested to see if this is permanent, yet.

On the command line:

sudo ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx

Or, to make it permanent, put it in /etc/network/interfaces


...
auto eth0
iface eth0 inet dhcp
...
hw ether xx:xx:xx:xx:xx:xx
...

If you get an error message, saying the “Device or Resource is busy” then you probably have to bring the interface down first: sudo ifconfig eth0 down. Use ifconfig eth0 to check that it worked – it should show the new address if no error was reported. Once that was done, I connected my computer to the modem and the provider was much more cooperative with my DHCP requests. 😀 Yay, Internet on my computer again! 🙂


Information about this entry:

4 Comments on “Faking MAC Address in Linux”

  1. popeko Says:

    telus allows 2 mac addresses per account.
    you could of added your machine and avoided all that nonsense.
    it should give you a page where you can add it/adjust the current one in your browser.

    but I know you like doing things the hard way

  2. Shyaarii Says:

    Huh, I am on Telus and I never knew about this mac address rule. My modem is also a wifi router, I guess that’s why.

  3. popeko Says:

    yeah, the first machine to connect on your telus account is accepted by default. (few years ago you had to phone it in)

    any further routers/ethernet cards need to be added to ‘the list’

    steve just couldn’t resist flaunting his big sensual brain meat

  4. Steve Says:

    Jesse, I feel your comment is simply too bitchy to warrant a reply, but I might as well lay it down.

    1) It’s not Telus, it’s Shaw. Holy shit! I think your argument was just shot down! I’d say that whole “don’t assume, it makes an ass outta you and me” thing, but in this case, it’s more like “assu.” But thanks for the related info, anyway. 🙂
    2) It doesn’t take long at all.
    3) This information could be useful to others searching for it, and it’s now kept for me if I need it in the future.

    You PMS-ing or something? Huh, Bitch? Huh? *smack smack* 😀

Leave a Comment

Allowed code: <a href="" title="">, <abbr title="">, <acronym title="">, <b>, <blockquote cite="">, <cite>, <code>, <del datetime="">, <em>, <i>, <q cite="">, <s>, <strike>, <strong>