How to Change Mac Address in Linux

Today we focusing How to Change Mac Address in Linux.

In this article we will talk how to Change Mac Address in Linux. Each network interface on your Linux operating system is associated with a unique number called a MAC (Media Access Control). Wireless and Ethernet network modules are examples of commonly used network interfaces in the Linux operating system. MAC plays a unique role in identifying these network interfaces through computer protocols and programs. If you change your computer’s MAC address, you can impersonate other devices on the same network.

This process is called MAC spoofing. In Linux, there are several tools you can use to change the MAC address of your device. A media access control (MAC) address is a unique number assigned to each network interface, including Ethernet and wireless. It is used by many computer programs and protocols to identify a network interface. One of the most common examples is DHCP, where a router automatically assigns an IP address to a network interface. Below are the steps to edit mac address in linux address in linux.

How to Change Mac Address in Linux

Find your MAC address and network interface

  • Let’s find some details about network card in Linux. Use this command to get network interface details:
  • In the output, you will see several details along with the MAC address:
    • Here it is: <லூப்பேக்,UP,LOWER_UP> mtu 65536 qdisc noqueue status UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    • eno1: <கேரியர் இல்லை, ஒளிபரப்பு, மல்டிகாஸ்ட்,UP> mtu 1500 qdisc fq_codel status down mode DEFAULT group default qlen 1000 link/ether 94:c6:f8:a7:d7:30 brd ff:ff:ff:ff:ff:ff
    • enp0s31f6: mtu 1500 qdisc noqueue status UP mode DORMANT group default qlen 1000 link/ether 38:42:f8:8b:a7:68 brd ff:ff:ff:ff:ff:ff
    • docker0: <நோ-கேரியர், பிராட்காஸ்ட், மல்டிகாஸ்ட்,UP> mtu 1500 qdisc noqueue status down mode DEFAULT group default link/ether 42:02:07:8f:a7:38 brd ff:ff:ff:ff:ff:ff

Change the MAC address using Macchanger

Macchanger is a simple utility to view, change and manipulate MAC addresses for your network interface cards. It is available on almost all GNU/Linux operating systems and you can install it using your distribution’s package installer.

  • On Arch Linux or Manjaro:
    • sudo pacman -S macchanger
  • On Fedora, CentOS, RHEL:
    • sudo dnf install mchanger
  • On Debian, Ubuntu, Linux Mint, Kali Linux:
    • sudo apt install macchanger

How to Use Macchanger to change MAC address

  • Do you remember the name of your network interface? You got it in step 1 earlier. Now, to assign any random MAC address to this network card, use:
    • sudo changer -r enp0s31f6
  • After changing the MAC ID, check it using the command:
  • Now you will see that the MAC is tricked.
  • To change the MAC address to a specific value, specify any custom MAC address using the command:
    • macchanger –mac=XX:XX:XX:XX:XX:XX
  • Finally, to change the MAC address to its original hardware value, run the following command:

Changing Mac Address Using iproute2

Macchanger But if you don’t want to use it, there is another way to change MAC address in Linux.

  • First, disable the network card using the command:
    • sudo ip link dev enp0s31f6 set below
  • Next, set the new MAC using the command:
    • sudo ip connection set dev enp0s31f6 address XX:XX:XX:XX:XX:XX
  • Finally, enable the network again with this command:
    • sudo ip link package dev enp0s31f6 up
  • Now, check the new MAC address:

Final words

We hope you like our article how to Change Mac Address in Linux Network cards have at least two addresses to be identified, at least one IP address (you can assign more than one) and one physical address, the MAC address. Just like an IP address, a MAC address is unique to each device. While IP address is a software address, MAC address is a hardware or physical address.

Faq

About This Guide?


In this guide, we told you about the How to Change Mac Address in Linux; please read all steps above so that you understand How to Change Mac Address in Linux in case if you need any assistance from us, then contact us.

How this tutorial or guide assisting you?


So in this guide, we discuss the How to Change Mac Address in Linux, which undoubtedly benefits you.



Share this article about How to Change Mac Address in Linux

I hope you like the guide How to Change Mac Address in Linux. In case if you have any queries regards this article/tutorial you may ask us. Also, share your love by sharing this article with your friends and family.
#Change #Mac #Address #Linux

Shagun Teotia
Trickbugs: Tips and Tutorials
Logo