piątek, 2 grudnia 2011

How to change MAC address under Linux Debian Squeeze

Changing MAC address should be easy, and it almost is. There are plenty of methods. I like this one - it will work for simple LAN configuration with DHCP, for one session. There is also simple modification to make it permanent. If it will work for WLAN - I have no idea.

In Debian there is something called Networking Manager. Networking Manager, automagically manages your network. So if you want to change MAC addres for card, you must first disable Networking Manager for this card . To do so:

  1. Open /etc/network/interfaces<
  2. Uncomment
    iface eth0 inet dhcp
  3. Add line
    auto eth0
  4. Save

Be sure that Networking Manager doesn't remember about your card and reboot or do:

$ /etc/init.d/network-manager stop
$ /etc/init.d/network-manager start

Now you are ready to change MAC address:

$ ifdown eth0
$ ifconfig eth0 hw ether 01:02:03:04:05:06
$ ifup eth0

If you want to revert to your original MAC address you have to repeat commands, giving your real MAC or reboot computer. I didn't find any method for restoring MAC to original state, without wiritng it again. If you know one, let me know.

Make it permanent

If you want to change MAC for longer than just one session in /etc/network/interfaces add another line, to stated above, under last line:

hwaddress ether 01:02:03:04:05:06

Macchanger

There is also program called macchanger, which does the same, but in one line. It's OK, but it still doesn't have option to restore real MAC address.

2 komentarze:

  1. In DHCP enabled network interface you can use following commands for changing ,MAC Address.

    auto eth0
    iface eth0 inet dhcp
    hwaddress ether AA:BB:CC:11:22:33


    Thanks
    Silvester Norman

    Changing MAC Address

    OdpowiedzUsuń