permanent change of MAC address in Mac OS X

Discussion in 'iMac' started by Apoph, Apr 6, 2011.

  1. Apoph macrumors newbie

    Apr 5, 2011
    Hi there.
    Basically, the title says all.
    I have question - how to change MAC address in Mac OS X permanently?
    I've tried using "sudo ifconfig en0 ether 00:01:02:03:04:05",
    but 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. So, is there a way to change it once and for all ?
  2. old-wiz macrumors G3

    Mar 26, 2008
    West Suburban Boston Ma
    The original address is hard encoded in the hardware. Any changes will be temporary and there's no way to do it permanently short of munging around with the hardware.
  3. smithrh macrumors 68020


    Feb 28, 2009
    I suppose you could put the desired MAC address in one of the launchd config files somehow, that way it would be changed at boot time.

    Caveat, I haven't learned launchd, only have been familiar with rc.boot and rc.local type config files, so maybe this wouldn't work.

    Apple sure doesn't seem to like supporting MAC address changes, you can't do this on Airport base stations either.
  4. Apoph thread starter macrumors newbie

    Apr 5, 2011
    Yeah, i need an ifconfig line to automatically change my MAC on boot. But how this can be done?
  5. Drewbie macrumors member

    Aug 27, 2010
    can you put that terminal command into an apple script?

    if you can put it in apple script you should be able to add that script to login items, which would run it upon logging into the system...
  6. tcassio macrumors newbie

    Mar 23, 2011
    I believe that you can't permantly chage any MAC address on any piece of hardware that has a nic interface. The system was designed this way to eliminate the possibility of 2 pieces of equipment from having the same MAC address.
  7. smithrh, Apr 6, 2011
    Last edited: Apr 6, 2011

    smithrh macrumors 68020


    Feb 28, 2009
    Lots of interfaces allow changing the MAC.

    Apple is a bit more strict here though. Why, not entirely sure.

    I understand what you're saying, MACs are supposed to be fixed but somehow over time they've become editable.
  8. Apoph thread starter macrumors newbie

    Apr 5, 2011
    I found these instructions. Will they work and is it safe to use them?

    Follow these steps to create a script that sets the MAC Address each time the computer restarts:

    1. Open Terminal (/Applications/Utilities/).
    2. Type: cd /Library
    3. Press Return.
    4. Type: mkdir StartupItems
    5. Press Return. (If you encounter an error, continue to step 6.)
    6. Type: cd StartupItems
    7. Press Return.
    8. Type: mkdir MACADD
    9. Press Return.
    10. Type: cd MACADD
    11. Press Return.
    12. Type: pico MACADD
    13. Press Return.
    14. In the pico editor, paste in the following text.

    Begin copying below this line.


    . /etc/rc.common

    # Configure a network interface MAC Address setting
    # This script will set the MAC Address setting for the specified interface(s)
    # The name of the interface (ex. en0) must be edited to match the interface
    # to which the MACADD setting should be applied

    StartService ()
    ConsoleMessage "Configuring MACADD"

    ### uncomment lines and change the value following 'MACADD' as appropriate mac address

    if [ "${MACADD:=-NO-}" = "-YES-" ]; then

    # /sbin/ifconfig en0 lladdr xx:xx:xx:xx:xx:xx
    # /sbin/ifconfig en1 lladdr xx:xx:xx:xx:xx:xx



    StopService ()
    return 0

    RestartService ()
    return 0

    RunService "$1"


    End copying above this line.

    15. Uncomment the /sbin/ifconfig line(s) to set the MACADD for a particular interface.

    Note: Removing the number sign (#) from the beginning of a line uncomments it. Typically, en0 is the interface name for the Built-in Ethernet port and en1 is interface name for the AirPort Card. This is not always the case, though. To confirm that a network port is associated with a particular interface name, open the Network Utility (/Applications/Utilities/), and click the Info tab.

    16. When you have finished customizing the file, save it (press Control-O), press Return, and exit pico (press Control-X).

    17. Type: chmod 755 MACADD

    18. Press Return.

    19. Type: pico StartupParameters.plist

    20. Press Return.

    21. In the pico editor paste in the following text.

    Begin copying below this line.


    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
    <plist version="1.0">
    <string>Can set MACADD</string>
    <string>Network Configuration</string>


    End copying above this line.

    22. When you have finished customizing the file, save it (Control-O), press Return, and exit pico (Control-X).
    23. Type: chmod 755 StartupParameters.plist
    24. Press Return.
    25. Type: sudo pico /etc/hostconfig
    26. When prompted, enter your password.
    27. Press Return.
    28. In the pico editor, add this line at the bottom:


    29. Save it (Control-O), press Return, and exit pico (Control-X).

    When you restart the computer, MACADD is set for the interface that you specified.


    1. The MACADD will be reset after changing a Location, waking the computer from sleep, or changing the state of the network interface. To use the script again without having to restart, enter the following command:

    sudo SystemStarter start MACADD

    2. If you experience any issues or wish to not set MACADD during startup, you can turn off the new script by changing the MACADD line in /etc/hostconfig to:


    Sorry, for a long post.
  9. JimMacFan macrumors regular

    Jan 13, 2009
    Why change MAC address? Up to no good?
  10. harcosparky macrumors 68020

    Jan 14, 2008

    BINGO !!!!

    What possible legitimate purpose could there be for changing a MAC address?

    MAC addresses are unique to each card, like the fingerprint on your fingers.


  11. Apoph thread starter macrumors newbie

    Apr 5, 2011
    Well some ISP bind internet connection to a certain MAC address. And i have few computers i need to connect sometimes.
    And the question was not "why do i need to change MAC address".
  12. harcosparky, Apr 7, 2011
    Last edited: Apr 7, 2011

    harcosparky macrumors 68020

    Jan 14, 2008
    Which ISP do you have that tells you to change the MAC address of a NIC?

    I mean even the IPS's know that a MAC address is hard coded and unique to each NIC.

    I've never heard of an ISP binding a connection to a SINGLE PC.
  13. smithrh macrumors 68020


    Feb 28, 2009
    Mine does. And it's one of the biggest ISPs out there.

    Having said that, I think the OP might look into buying a router if this is indeed the issue.
  14. Mastrix56 macrumors newbie

    Aug 9, 2013
    Thanks for the Info and a question


    What types of parameters need changing in the StartupParameters.plist?

    I didnt change anything in that file and its not working for me.

  15. jsw, Aug 9, 2013
    Last edited: Aug 9, 2013

    jsw Moderator emeritus


    Mar 16, 2004
    Andover, MA
    This is, by far, the best way to go about doing this.

    Get a router with an alterable MAC address, hook it up, profit.

    Edit: my apologies... I didn't realize how old this thread was prior to the reply above mine.
  16. tobefirst macrumors 68040


    Jan 24, 2005
    St. Louis, MO
    At the Panera Bread closest to my home (where they call them St. Louis Bread Co), they have a 30 minute limit on their wifi, even during non-peak times. I've changed my MAC address to get around this limitation.
  17. Mastrix56 macrumors newbie

    Aug 9, 2013

    I totally agree with the router, its hard to find one that doesn't let you change the MAC. Comcast will many times install to a single PC and use the MAC of the PC NIC and limit you on the network to only that MAC address. Not always, its weird. Then you want to add devices and a wifi router and you have to spoof the address.

    I think a lot of people want to do it at the laptop layer so the MAC is protected whereever they roam. Scandalous reasons? Better security, the right to anonymity, I dont know but the script is very useful and appreciated

Share This Page