Jump to content

Applescript to set your MAC address on startup

1 post in this topic

Recommended Posts

There are several ethernet cards out there that work, but will give a MAC address of all zeros, 00:00:00:00:00:00 You have to use the terminal each time you restart to set the MAC address. This applescript will automatically set the MAC address on startup. You won't have to do anything, it is all automatic.


1. Open AppleScript Editor and paste the following into a new file.


set newMac to "00:13:72:1B:FF:D1"
set psswrd to "your_password"

repeat with counter from 0 to 50
set currMac to (do shell script "ifconfig en0" & " | grep 'ether '")
if currMac contains "ether" then
exit repeat
end if
on error
delay 2
end try
end repeat

do shell script "ifconfig en0" & " ether " & newMac password psswrd with administrator privileges


2. Replace 00:13:72:1B:FF:D1 and your_password with your own MAC address and password.


3. Save the AppleScript in File Format Application and check the Run Only box. Name it something descriptive like "SetMacAdd." Save it in Applications or somewhere else where you can find it.


4. Open System Preferences and click on Accounts.


5. In Accounts click on the Login Items tab and the use the "+" to add your saved AppleScript to the list of login items.


6. Restart to check if it works.



*Systems running Tiger will use lladdr instead of ether in the script.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By enq1n
      Hello friends.   imessage not working ,After changed mac address( i used Mobile Terminal ,and put this command: nvram wifiaddr= xx.xx.xx.xx.xx.xx )  ,, i came back original mac address, but still not working     I did restore,but does not work,  I used this command    "nvram -d wifiaddr"  but doesnot work.
         I think I disrupt nvram.How can i learn source of problem. ?  How can i fix this?   
      this photo is when i put "ifconfig" command            My phone is iphone 4s  jailbroken   Thanks
    • By linhdh
      Hello all,
      I want to change mac address of wifi card of my Macbook air 11.6" version 2013 which has already updated to use mac os x 10.9.2.
      Firstly, i used the command:
      sudo ifconfig en0 ether <my new mac address>
      en0 is my wifi card. But i think it didn't work.
      When i used command
      ifconfig en0
      i could see that mac address of en0 changed to <my new mac address> but Wi-Fi address showed on Network Preferences > Advanced > Wi-fi is still the origin mac address of my Wi-Fi card.
      Do you know anyway to know for sure what is the current mac address of your wifi card?
      After that i tried to port some code of Macchanger from GNU (http://ftp.gnu.org/gnu/macchanger/) to my mac so that i could try to change mac address with this software (it basically use ioctl to change mac address). I could make it run but i fear that may damage my hardware. I'm very new to mac and linux development.
      Do you know how to change mac address programmatically for mac os x 10.9.2?
      Do you know anyway which differ from my ways to change mac address for my wifi card on Mac os x 10.9.2?
      Thank you for reading.
      Any response will be appreciated.