Change MAC address

OP
imfromwales
Joined
Apr 11, 2013
Messages
194
Reaction score
2
Points
18
Your Mac's Specs
13" rMBP 2014, 8GB RAM, 128GB SSD, 2.6GHz i5
Actually yes, because it re-sets each time on restart, I can set the original as a variable, rather than output it to a file. Thanks for your help :)

Do you know any commands to take just the MAC address, rather than "ether a2:a4:a5:a6:A6" (so exclude the word ether)?
 
OP
imfromwales
Joined
Apr 11, 2013
Messages
194
Reaction score
2
Points
18
Your Mac's Specs
13" rMBP 2014, 8GB RAM, 128GB SSD, 2.6GHz i5
Actually I have found that the following command strips the word ehter V1=$(ifconfig en1 | awk '/ether/ {print $2}')

Although I am having trouble, once I have created a MAC address, assigning it to a variable, I can only echo it. Why cant I set the following to a variable?

echo -n $V2; dd bs=1 count=3 if=/dev/random 2>/dev/null |hexdump -v -e '/1 "-%02X"'

V2 is the first 6 characters of my MAC address, formated like a2-a3-a4
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top