How to change MAC address

Sivaram Rasathurai
Hacking Hunter
Published in
2 min readMar 23, 2019

This is a short form for Media Access Control address. The MAC is permanent and unique address for each network interface card. This is assigned by the manufacturer. Unique means, there is no two devices with the same MAC address in the world. MAC addresses are used to identify the devices in the network to transfer the data. Why we want to change MAC address, because we can increase anonymity in the network. Transferring data packet uses MAC address to get to a destination, when we change our MAC address to impersonate other devices we can receive those. More important one is, we can hide our identity.

You can change your MAC address manually as given below but this change is temporary. If you restart your machine, the MAC address will be changed to old MAC address which was given by manufacturer

I Changed my mac address in my system like this way

If you use window versions then you should use ipconfig instead of ifconfig. First we want to select the interface which we want to change MAC address using ifconfig to get the information about your network interfaces. If you want to change particular interface then first, disable the interface using ifconfig INTERFACE_NAME down. In my example, I used to down my enp0s20f0u5c2 interface using following command

ifconfig enp0s20f0u5c2 down

Now, you can change your MAC address to the particular interface. for this purpose, ifconfig INTERFACE_NAME hw ether NEW_MAC_ADDRESS, in this command you want to put the interface name which you deactivated and new MAC address which you prefer. In my example, I used enp0s20f0u5c2 interface and new MAC address is 00:11:22:33:44:55

ifconfig enp0s20f0u5c2 hw ether 00:11:22:33:44:55

Now, you want to enable your interface. it is very easy using this following command to up your interface which was already down. ifconfig INTERFACE_NAME up in my example i up the interface enp0s20f0u5c2 with the following command

ifconfig enp0s20f0u5c2 up

This the python code for changing mac address automatically

Thanks for reading.

--

--