Macchanger - MAC Address Spoofing For Linux.
This is a tool that makes the manipulation of MAC addresses of network interfaces easier.
MAC address spoofing is a technique for temporarily changing your Media Access Control (MAC) address on a network device.
A MAC Address is a unique and hardcoded address programmed into network devices, like your NICs, set by the manufacturer at the factory. which cannot be changed permanently.
The MAC address is in the second OSI layer and should be seen as the physical address of your interface.
However, many drivers allow the MAC address to be changed and there are software tools which can make an operating system believe that the NIC has the MAC address of a user's choosing.
The process of masking a MAC address is known as MAC spoofing and there could be several reasons as to why you would want to do this.
Latest version: 1.7.0-5.4 available in Debian 11 "Bullseye" repository.
How to install via a terminal window:
sudo apt-get install macchanger
Press Enter, wait and you will be asked if you want to change the MAC-address automatically every time you re-boot your computer.
You can also do this manually if you want to.
First you need to take down the network adapter in order to change the MAC address.
Note: ifconfig tool is depreceated and has been replaced by iproute2.
The iproute2 suite is a collection of utilities for networking and traffic control.
You can make sure that iproute2 is installed by running the following command:
sudo dpkg -s iproute2
Next lets list the network interfaces:
sudo ip link show
If you want a short list presented in a much nicer way, you can use this command:
sudo nmcli device status
It will list DEVICE, TYPE, STATE and CONNECTION.
Now lets take down wlp3s0 (former wlan0).
Network interface naming rules changed with Debian 9.
sudo ip link set wlp3s0 down
Use the following command to change your MAC address to a new random MAC Address:
sudo macchanger -r wlp3s0
Macchanger will show you the permanent, current and changed MAC address.
The permanent MAC Address will be restored to your network adapter after a reboot, or you can reset your network adapters MAC address manually.
sudo macchanger –permanent wlp3s0
It is also possible to spoof a particular MAC address using the following command:
sudo macchanger -m XX:XX:XX:XX:XX:XX wlp3s0
Note: Replace XX:XX:XX:XX:XX:XX with the Mac address and if you get ERROR: Can’t change MAC: interface up or not permission: Cannot assign requested address. You need to take down the network interface first before changing the MAC Address.
To bring it back up:
sudo ip link set wlp3s0 up
Use the following command to show the current MAC address:
sudo macchanger --show wlp3s0
Press Enter. Done