Changing MAC addresses

Majority of information from Wikipedia article. Reproduced and published under terms of the GFDL

Although physical MAC addresses are permanent by design, several mechanisms allow modification, or "spoofing", of the MAC address that is reported by the operating system. This can be useful for privacy reasons, for instance when connecting to a Wi-Fi hotspot, or to ensure interoperability. Some internet service providers bind their service to a specific MAC address; if the user then changes their network card or intends to install a router, the service won't work anymore. Changing the MAC address of the new interface will solve the problem. Similarly, some software licenses are bound to a specific MAC address. Changing the MAC address in this way is not permanent: after a reboot, it will revert to the MAC address physically stored in the card.

As a MAC address can be changed, it can be unwise to rely on this as a single method of authentication. IEEE 802.1x is an emerging standard better suited to authenticating devices at a low level.


Under Linux, the MAC address of a Network Interface Card (NIC) can be changed by doing the following: (You must be root in order for this to work)

/etc/init.d/networking stop
ifconfig eth0 hw ether 02:01:02:03:04:08
/etc/init.d/networking start

Under Fedora Core 5, and possibly in other Linux distributions, to disable and restart networking, one must stop and start /etc/init.d/network, instead of /etc/init.d/networking. If you have the Iproute2 tools installed, you may prefer to use the ip command instead:

/etc/init.d/network stop
ip link set eth0 address 02:01:02:03:04:08
/etc/init.d/network start

To confirm your setting you may prefer to use ip link ls eth0 or ip addr ls eth0 instead of using ifconfig eth0.

NOTE: You may not be able do this if using a DSL modem (depending on modem vendor or ISP).

In Red Hat Linux and other similar systems (Fedora Core, etc) an easy way to make it "permanent" across reboots is to just add a variable like this to your ifcfg-eth0 or similar file:


(Upper or lower case on the MAC address are fine, because the network function converts it to upper case.)

and service network restart for prompt results.

In Debian just put

hwaddress ether 02:01:02:03:04:08

in the appropriate section of /etc/network/interfaces so that the MAC address is set when the network device is started.

You can also use the tool MACChanger to change the MAC address under Linux.

To change MAC address during boot time with MACChanger,add the following line to your /etc/network/interfaces

pre-up macchanger -m 12:34:56:78:90:AB eth0


Under FreeBSD, the MAC address can be changed in a similar way:

ifconfig fxp0 ether 02:01:02:03:04:05

(This can be done without needing to take the interface down and back up)


As of OpenBSD 3.8, the MAC address can be changed as follows:

ifconfig bge3 lladdr 02:01:02:03:04:05

Mac OS X

Under Mac OS X, the MAC address can be altered in a fashion similar to the Linux and FreeBSD methods:

ifconfig en0 lladdr 02:01:02:03:04:05


ifconfig en0 ether 02:01:02:03:04:05

This must be done as the superuser and only works for the computer's ethernet card. Instructions on spoofing AirPort Extreme (2.0) cards are available here. There are not, as of yet, any known ways to spoof original AirPort (1.0) cards.

The AirPort Extreme MAC address can also be changed easily with SpoofMac, available here: 9 July 2006 update: SpoofMac seems to have been discontinued.


Under Windows XP, the MAC address can be changed in the Ethernet adapter's Properties menu, in the Advanced tab, as "MAC Address", "Locally Administered Address", "Ethernet Address", "Physical Address" or "Network Address". The exact name depends on the Ethernet driver used; not all drivers support changing the MAC address in this way.

However, a better solution - requiring Administrative User Rights - is to pass over the System Registry Keys under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}. Here settings for each network interface can be found. The contents of the string value called 'NetworkAddress' will be used to set the MAC address of the adapter when next it is enabled. Resetting the adapter can be accomplished in script with the freely available command line utility devcon from Microsoft, or from the adapters context menu in the Network Connections control panel applet.

There is a FREEWARE software available called Technitium MAC Address Changer v3.1 which allows you to change MAC address of your network interface card (NIC) in seconds, irrespective of its driver or manufacturer.

Note: to check your MAC address easily under Windows NT4, Windows 2000 or Windows XP: Click "Start", choose "Run...", type CMD and click OK, then type "ipconfig /all" (without quotation) in the Command Prompt window that appears. The number under physical address is the MAC address. If multiple IP are displayed, you should look under the label "Ethernet adapter x", where x is the name of your connection (which is Local Area Connection by default).

Other systems

You can use a third-party utility to change the MAC of almost any Ethernet adapter - two of them are listed below in External Links.

Most consumer-grade routers allow for a user-specified MAC address to be given.

Change The MAC Address Permanently

Download diagnostic programs for your card from this link. Currently the link is being redirected to another location. If someone knows a mirror, please update the link (or add a second one), and delete this message. Compile and run under Linux.

cc -O -Wall -o rtl8139-diag rtl8139-diag.c
./rtl8139-diag -w -H 12:34:56:78:9a:bc

Under Linux:

ifconfig <interface> hw <class> <address>

Under FreeBSD:

ifconfig <interface> link <address>