This program in order to pay close attention to the current number of people infected with Corona-Virus, which displays the current statistics on the display. Datasource Data used in this project came from this Website. BeautifulSoup was used to extract the data. Make it work If you just want to print the informations on the terminal, you may just run the fetch_print.py To display it on the LCD2...
Before showing you how to change the MAC address in Linux, let's first discuss why it should be changed.
There may be several reasons. Maybe you don't want to expose your actual MAC address (also known as a physical address) on a public network? It is also possible that the network administrator has blocked specific MAC addresses in the router or firewall.
A practical "benefit" is that some public networks (such as airport WiFi) allow free internet access for a limited time. If you want to keep using it, forging your Mac address can trick the network into thinking it's a new device. This is also a reason.
I will show the steps to change the MAC address (also known as fake MAC address).
Changing the MAC address in Linux
Let's go step by step:
Find your MAC address and network interface
Let's find out some details about network cards in Linux. Use this command to get the network interface details:
ip link show
In the output, you will see some details as well as the MAC address:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eno1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000 link/ether 94:c6:f8:a7:d7:30 brd ff:ff:ff:ff:ff:ff 3: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000 link/ether 38:42:f8:8b:a7:68 brd ff:ff:ff:ff:ff:ff 4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default link/ether 42:02:07:8f:a7:38 brd ff:ff:ff:ff:ff:ff
As you can see, here my network interface is called enp0s31f6 and the MAC address is 38:42:f8:8b:a7:68.
You may need to write it down in a safe place to restore to the original MAC address later.
Now you can continue to change the MAC address.
If you do this on the network interface that you are currently using, you may lose your network connection. Therefore, try this method on another network card, or prepare to restart the network.
Method 1: Use Macchanger to change the MAC address
Macchanger is a simple program for viewing, modifying, and manipulating the network card's MAC address. It is available on almost all GNU / Linux operating systems and you can install it using the distribution's package installer.
On Arch Linux or Manjaro:
sudo pacman -S macchanger
On Fedora, CentOS, and RHEL:
sudo dnf install macchanger
On Debian, Ubuntu, Linux Mint, Kali Linux:
sudo apt install macchanger
You'll be asked to choose whether you should set macchanger to run automatically every time you start or shut down your network device. Whenever you receive a network cable or restart your WiFi, it provides a new MAC address.
Not a good idea to run it automatically!
I recommend not running it automatically unless you really need to change the MAC address every time. So, select "No" (press the Tab key) and press Enter to continue.
How to change MAC address with Macchanger
Do you remember the network interface name? You got it in the previous steps.
Now, to assign a random MAC address to the network card, use:
sudo macchanger -r enp0s31f6
After changing the MAC, use the following command to verify:
Now you will see that the MAC has been forged.
To change the MAC address to a specific value, use the following command to specify a custom MAC address:
macchanger --mac = XX: XX: XX: XX: XX: XX: XX
Where XX: XX: XX: XX: XX: XX is the new MAC you want to change.
Finally, to restore the MAC address to its original hardware value, run the following command:
macchanger -p enp0s31f6
But you don't have to. After restarting the system, the changes will be lost automatically and the actual MAC address will be restored again.
You can always check the man page for more details.
Method 2: Use iproute2 to change your Mac address
I suggest you use macchanger, but if you don't want to use it, there is another way to change the MAC address in Linux.
First, use the following command to shut down the network card:
sudo ip link set dev enp0s31f6 down
Next, set the new MAC using the following command:
sudo ip link set dev enp0s31f6 address XX: XX: XX: XX: XX: XX
Finally, reopen the network using the following command:
sudo ip link set dev enp0s31f6 up
Now verify the new MAC address:
ip link show enp0s31f6
That's it. You have successfully modified the MAC address in Linux.