Change MAC address?

Discussion in 'macOS Mojave (10.14)' started by chemistry76, Nov 13, 2018.

  1. chemistry76 macrumors member

    Joined:
    Jun 22, 2011
    #1
    Is there a way to change the Mac address (wifi) on a 2018 MacBook Air running Mojave?

    Googling around, and it seems that the old solution (High Sierra and older) no longer works, and the app WifiSpoof is broken in Mojave.

    Has anyone found a solution?

    Thanks.
     
  2. solouki macrumors member

    solouki

    Joined:
    Jan 5, 2017
    #2
    Hi chemistry76,

    I just checked the standard commandline method for changing the ethernet MAC address under Mojave 10.14.1 and it works fine without any problems.

    For instance, using the Terminal, first save your original MAC address:

    ORIGINALMAC=`ifconfig en0 | grep ether | awk '{print $2}'`
    echo " MAC address: ${ORIGINALMAC}"


    Then use openssl to generate a new random MAC address:

    RANDOMMAC=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`
    echo " Random MAC address: ${RANDOMMAC}"


    Then reset your ethernet en0 MAC address to the random one:

    sudo ifconfig en0 ether `echo ${RANDOMMAC}`
    sudo ifconfig en0 down
    sudo ifconfig en0 up


    Then check that the MAC address has changed:

    ifconfig en0

    Then reset the MAC address back to the original one:

    sudo ifconfig en0 ether `echo ${ORIGINALMAC}`
    sudo ifconfig en0 down
    sudo ifconfig en0 up


    And check that the MAC address is back to the original:

    ifconfig en0

    Worked for me ... hope it helps you. (Of course, you need Administrator privileges.)

    I changed my ethernet MAC address instead of my WiFi MAC address because I didn't want to affect my WiFi connection to my router (since I only allow known MAC addresses to connect to my router). But the same should work for your WiFi network, you just have to figure out the name of your WiFi, for me it is "en1". If you execute the "ifconfig" command by itself, you then find the entry that has your proper inet address (the IP address listed in the Network Pane of System Preferences). If your WiFi is "en1" (like mine), you would then substitute "en1" for all instances of "en0" in the above commandlines.

    So, to find your WiFi card:

    ifconfig

    Regards,
    Solouki

    P.S. Of course, this does not change the NVRAM parameter and thus is a temporary change of the MAC address.
     
  3. chemistry76 thread starter macrumors member

    Joined:
    Jun 22, 2011
    #3
    Did you do this on a 2018 MacBook Air or MacBook Pro?

    This is the response I get in terminal when I type in sudo ifconfig en0 ether xx:xx:xx:xx:xx:xx (I have a Mac address in mind)

    sudo: ifcongig: command not found

    This seems to be the problem with the new 2018 MacBooks.
     
  4. D.T. macrumors G3

    D.T.

    Joined:
    Sep 15, 2011
    Location:
    Vilano Beach, FL
    #4
    That command should be available in your OS, if you're in terminal, at a prompt, and you simply type: ifconfig

    ... you're saying the command isn't found? What if you type ls /sbin ? You should see a directory listing and ifconfig listed as one of the files[?]
     
  5. chemistry76 thread starter macrumors member

    Joined:
    Jun 22, 2011
    #5
    ifconfig is listed, and if I just type ifconfig it displays a plethora of information.

    But when I type in:

    sudo ifconfig en0 ether xx:xx:xx:xx:xx:xx

    I get:

    sudo: ifcongig: command not found

    Before I posted here, I googled around trying to figure out how to change the MAC address of my machine - a 2018 MacbBook Air.

    This problem apparently began with the 2018 MacBook Pros. I was hoping someone here might have figured out a way to make it work.
     
  6. chrfr macrumors 604

    Joined:
    Jul 11, 2009
    #6
    It appears you're typing "ifcongig" rather than "ifconfig".
     
  7. chemistry76 thread starter macrumors member

    Joined:
    Jun 22, 2011
    #7
    Ahh.. Yes, I did. However I'm still unable to change the mac address.

    Typing sudo ifconfig en0 ether f4:0f:4f:xx:xx:xx no longer returns an error message, but it still doesn't change the mac address. Here are some threads I've found with others having the same problem on 2018 Macbook Pros and Airs with Mojave:

    https://www.reddit.com/r/macbook/comments/93h2mi/mac_address_changing_on_new_2018_mbp_broken/

    https://github.com/feross/SpoofMAC/issues/87
     
  8. solouki macrumors member

    solouki

    Joined:
    Jan 5, 2017
    #8
    Hi chemistry76,

    I tested the exact Terminal commands that I listed above on an iMac running macOS 10.14.1 since the iMac has an ethernet interface. But if you wish, I can try it on a 2018 MBP too?
     
  9. DeltaMac macrumors G3

    DeltaMac

    Joined:
    Jul 30, 2003
    Location:
    Delaware
    #9
    The 2018 would have the extra security command, that you have to turn off the system security (some function name that I don't recall atm) in terminal after booting to your recovery system. Reboot normally, then try the ifconfig command again.
     
  10. Howard2k macrumors 68000

    Howard2k

    Joined:
    Mar 10, 2016
    #10
    System Integrity Protection?
    https://www.imore.com/how-turn-system-integrity-protection-macos
     
  11. solouki macrumors member

    solouki

    Joined:
    Jan 5, 2017
    #11
    Interesting ... as SIP is a feature of the Mojave 10.14.1 OS that I was using on the iMac and I didn't have to turn off SIP (csrutil disable, while in Recovery Mode) in order to change the MAC address on my iMac. It did require administrator privileges, but it did not require SIP to be disabled. Maybe I should check changing the MAC address on my 2018 MBP ... I'll do this when I have a chance.
     
  12. DeltaMac macrumors G3

    DeltaMac

    Joined:
    Jul 30, 2003
    Location:
    Delaware
    #12
    I posted too late last night... I was thinking of disabling SIP - but maybe the T2 security should be turned off, too?
    I don't have one of the newer Macs with that extra layer of security.
     
  13. machine8 macrumors newbie

    Joined:
    Dec 16, 2018
    #13
    Any updates? There're threads on reddit and github that on latest mbp ifconfig doesn't change MAC address even on external dongles.
     
  14. JMBMac macrumors newbie

    Joined:
    Jan 9, 2019
    #14
    Hey there,

    I just worked this out but if you don't want to use a random MAC address then you can just create a variable with the mac address you want to use stored on there ie:

    NEWMAC=(xx:xx:xx:xx:xx:xx)
    sudo ifconfig en0 ether `echo ${NEWMAC}`
    sudo ifconfig en0 down
    sudo ifconfig en0 up

    This should be a good method to set your MAC address to something you want to too instead of something random.

    To change back to original view the first answer
     

Share This Page