If you don’t want to expose your device MAC address while connecting to Public WIFI’s or maybe the firewall or router blocked the specific MAC address, changing of MAC address to access internet service without being exposing the original MAC address. Changing of MAC address is also known as MAC Spoofing or FAKE address. In this tutorial, we will learn how to change the MAC address in CentOS8.
To find out the MAC address or hardware address of a network interface, open the terminal and use anyone of the following command.
# ip link show
# ifconfig | grep ether
These commands will display the hardware address of your network interface card. Sample output is attached below for reference.
We can do this in two methods. Please be careful not to change your mac address with the live network card. If you do this, it will disconnect your network connection. Use this method with an additional network card.
To change the MAC address of a network card, you have to turn off that network card. Navigate to the terminal and use the following command.
# sudo ip link set dev ens37 down
the word ens37 is the device name of the network card, it might differ on your system. So adjust the command to match your network card device name. Do the same in the following commands.
Next, assign the MAC address of your own choice using the following command.
# sudo ip link set dev ens37 address XX:XX:XX:XX:XX:XX
Finally, turn on the interface with the following command.
# sudo ip link set dev ens37 up
Now, verify the new MAC address by using the following command.
# ip link show ens37
New MAC address has assigned successfully.
You can also change the MAC address from the configuration file, for this open up the configuration file of that specific interface.
# sudo vim /etc/sysconfig/network-scripts/ifcfg-ens37
Add/Edit the MACADDR according to your own MAC address.
Exit and save the configuration file and restart the network, using the following command.
# sudo systemctl restart network
Again, verify the new MAC address.
In this tutorial, we learned how to change the MAC address of a network card using two different methods and after changing we also verify that new MAC address.
Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…
ISPConfig is an open-source control panel that allows users to manage multiple servers from a…
As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…
Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…
Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…
phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…