MacOS – Lost connection after spoofing MAC address

mac addressmacos

I've changed the MAC address using

$ ifconfig en1 |grep ether
    ether b2:n7:v8:x6:31:k2
$ openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'
69:b5:32:54:75:38
$ sudo ifconfig en1 ether 69:b5:32:54:75:38 
Password:
$ ifconfig en1 |grep ether
    ether 69:b5:32:54:75:38

After that all my network connections got lost. Why is this happening?

Best Answer

From man ifconfig:

ether   Another name for the lladdr parameter.

lladdr addr
    Set the link-level address on an interface.  This can be used to e.g. set a new
    MAC address on an ethernet interface, though the mechanism used is not
    ethernet-specific. The address addr is specified as a series of colon-separated
    hex digits.  If the interface is already up when this option is used, it will
    be briefly brought down and then brought back up again in order to ensure that
    the receive filter in the underlying ethernet hardware is properly reprogrammed.

So loosing the connection is the expected behavior here.