Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sometimes I need to spoof MAC address, I'm doing so with this command:

ip link set dev eth0 address XX:XX:XX:XX:XX:XX

Is there a way how to set MAC address back to default without reboot?

share|improve this question
up vote 3 down vote accepted

See also:

sudo ethtool -P eth0

So, to set the MAC address back to its default (assuming GNU grep here):

set_to_real() (
  for i do
    mac=$(ethtool -P "$i" | grep -iEom1 '([0-9a-f]{2}:){5}[0-9a-f]{2}') &&
      ip link set dev "$i" address "$mac"
set_real eth0
share|improve this answer

Your "real MAC" might be reported by the kernel on boot, so have a look at

dmesg | grep eth0

and try using your ip link set... with the MAC you find there.

share|improve this answer
Well, I was looking for something else (like eth0 address "set-to-real") but this is also a solution, thanks! :-) – Micer Nov 28 '12 at 13:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.