How to Spoof a MAC Address in Linux

In some ethical hacking engagements, you might need to spoof the MAC address of a network interface card. This short list of steps help you do that:

1. Find the name of the interface you want to spoof the MAC of.


You’ll see interface names such as “eth0”, or “ens33”, depending on the Linux distro you’re using.

Note: If this command doesn’t exist, you can install the “net-tools” package through “apt”, “yum” or any other package manager you use.

2. Turn the interface off:

ifconfig ens33 down

Replace “ens33” with your interface name of choice.

3. Update the MAC address:

ifconfig ens33 hw ether 12:34:56:78:90:12

Replace the “12:34:56:78:90:12” with the MAC address of your choice.

4. Turn the interface on:

ifconfig ens33 up

That’s all!