• Home
  • Windows
    • Windows 10
    • Windows 11
  • Mac
  • iOS
  • iPad
  • iPhone
  • Social Media
  • News
Thursday, March 30, 2023
HowToFixIssue
Advertisement
  • Home
  • Windows
    • Windows 10
    • Windows 11
  • Mac
  • iOS
  • iPad
  • iPhone
  • Social Media
  • News
No Result
View All Result
  • Home
  • Windows
    • Windows 10
    • Windows 11
  • Mac
  • iOS
  • iPad
  • iPhone
  • Social Media
  • News
No Result
View All Result
HowToFixIssue
No Result
View All Result
Home How To

How to Change MAC Address in Linux (Two Methods)

March 12, 2023
in How To
Reading Time: 11 mins read
How to Change MAC Address in Linux (Two Methods)

InterestingPosts

USB Vs PCIe Wi-Fi—Which One Is Better?

How To Change Toner On Brother Printer

How to Change MAC Address in Linux (Two Methods).

The MAC deal with is a novel identifier assigned to each device linked to a network. Even although the MAC deal with is everlasting, chances are you’ll wish to change it in your device in some circumstances. For instance, you may change the MAC deal with in your device to cover your identification or to resolve network compatibility points. With that in thoughts, this information will present you ways to vary the MAC deal with on a Linux device. So whether or not you’re a newbie or an skilled Linux person, comply with this information to switch the MAC deal with in a fast and simple method.

Changing the MAC Address in Linux (2023)

What is MAC Address?

As talked about above, the MAC Address (or Media Access Control deal with) is a novel identifier used to acknowledge gadgets linked to a network. This deal with is used to determine and talk with different gadgets, be it a pc, smartphone, or printer, on a network.

The MAC deal with is a 48-bit hexadecimal deal with consisting of six units of two digits or characters separated by colons or hyphens. It can also be known as the Physical deal with or Burned-in deal with. That’s as a result of the MAC deal with is assigned by the producer and is burned into the device’s {hardware}. So it normally can’t be modified, or at the very least they don’t change on their very own like an IP deal with.

Difference Between MAC Address and IP Address

Each network device wants at the very least two addresses to get acknowledged by different gadgets and network interfaces – one is the MAC deal with, and the opposite is the IP deal with (Internet Protocol deal with). While the previous is used to uniquely determine gadgets on a network, the latter helps determine a tool’s connection to the network. That means an IP deal with makes it simpler to find your device, so the network is aware of the place to ship your knowledge. Moreover, the IP deal with will get assigned by the Internet Service Provider(ISP), and the MAC deal with is assigned by the producer, as we talked about above.

However, we will change the MAC deal with using some neat software program tips, which we are going to be taught on this article. Unlike an IP Address, which could be modified completely, the MAC deal with will get reverted to the unique producer’s deal with if you reboot the device.

Why You May Want to Change the MAC Address?

There could also be quite a few explanation why you wish to change the MAC deal with in your Linux pc. Changing the MAC deal with makes the network gadgets deal with you want a brand new particular person. This can make you utterly nameless on a public network, therefore, defending you from cyberattacks on a public network. You also can get entry to limitless free public Wi-Fi at airports, cafes, and so forth., by altering your device’s MAC deal with.

The MAC deal with change may also be used for some unlawful actions, comparable to impersonating the admin of a company. By altering your MAC deal with to that of the admin, you may achieve unlawful entry to restricted networks. However, we condemn any such malicious actions and advise in opposition to them.

Installing Package to Change MAC Address in Linux

There are a number of Terminal instruments, comparable to macchanger, net-tools, and so forth., that may provide help to change the MAC deal with in your Linux PC. Here, we now have listed the Linux instructions to put in each packages, so comply with alongside.

To set up macchanger and net-tools packages on a Debian-based system, use the next command:

sudo apt set up macchanger net-tools

For CentOS-based programs, use the next command to put in the packages:

sudo yum set up macchanger net-tools

To set up the 2 packages in Arch-based programs, use the next command:

sudo pacman -S macchanger net-tools

While putting in the macchanger package deal, it shows a immediate asking customers whether or not they want to change the MAC deal with each time they boot into the system or not. Use the arrow keys to navigate the alternatives. Choose both Yes or No, relying in your choice. Then, hit Enter to substantiate your selection.

macchanger prompt during installation in Linux

How to Change the MAC Address Temporarily

Step 1: Checking for Network Devices

Before you modify the MAC deal with, you should know what’s the identify of the device and its present MAC deal with. To record all of the network gadgets current in your system, use this command:

ifconfig

How to Change MAC Address in Linux

For older programs or in case of any errors, use the next command:

ip addr present

How to Change MAC Address in Linux

When you run the command, the primary a part of the output shows the Loopback deal with info, which could be acknowledged with the lo label and is used for diagnosing any issues within the network.

The second part exhibits particulars in regards to the network interface, which is eth0 on this instance. Furthermore, the ether sub-label specifies the {hardware} deal with or the MAC deal with, which is 08:00:27:05:10:68 in our case. The inet sub-label specifies the IPv4 IP deal with and the inet6 sub-label specifies the IPv6 IP deal with.

Step 2: Disabling the Network Device

Now that you’ve got famous your network interface identify, you first must disable the device’s connection to the network to vary its MAC deal with in Linux. Disable the device using the next command:

sudo ifconfig <interface_name> down

How to Change MAC Address in Linux

When you run this command, you’re going to get disconnected from the web. If the above command doesn’t work in your system, you may both reinstall the net-tools package deal or use the next command:

sudo ip hyperlink set dev <interface_name> down

How to Change MAC Address in Linux

Step 3: Changing the MAC Address

After you may have disabled the device’s network connection, now you can change the MAC deal with. Use the next command to vary the MAC deal with in Linux.

sudo ifconfig <interface_name> down hw ether <new_mac_address>

Then, you may allow the device once more using this command. Run the instructions to ensure that the specified end result.

sudo ifconfig <interface_name> up

How to Change MAC Address in Linux

In case of any errors, use the next command to vary the MAC deal with and allow the device’s network connection:

ip hyperlink set dev <interface_name> deal with <new_mac_address>

ip hyperlink set dev <interface_name> up

Step 4: Verifying the Changes Made

To confirm that the MAC deal with of your Linux system has modified efficiently, run the next command:

ifconfig

verifying new mac address

And in case of any errors or in case your system is outdated, use the next command:

ip addr present

How to Change the MAC Address Permanently

Step 1: Checking for Network Device

Like the earlier part, you first must record all of the network gadgets within the system and notice down the interface identify using the next command:

ifconfig

listing network devices

To see the present MAC deal with of the network interface, use the next command:

sudo macchanger --show <interface_name>

checking the current mac address

Step 2: Assigning A New MAC Address

When using the macchanger software to vary the MAC deal with completely, you do not want to disable the device network connection and re-enable it. You can immediately assign a random MAC deal with to your PC using the next command:

sudo macchanger -r <interface_name>

changing the mac address using macchanger

To assign a specific MAC deal with in Linux use the command beneath. You might want to specify the MAC deal with (6 units of two digits or characters separated by colons) you want to assign to your Linux system. Here is what the syntax appears like:

sudo macchanger --mac=<mac_address> <interface_name>

For instance, we now have modified the mac deal with to 00:00:00:31:33:73 for the interface eth0 using the command beneath.

sudo macchanger --mac=00:00:00:31:33:73 eth0

assigning a specific mac address for eth0 interface

Step 3: Making Changes Permanent

1. To get a brand new MAC deal with every time you boot into the system, you may create a /and so forth/systemd/system/changemac@.service systemd unit file using a Linux textual content editor of your selection. For that, kind the next command within the Terminal:

sudo vim /and so forth/systemd/system/changemac@.service

2. Then, paste the next textual content contained in the changemac@.service file:

[Unit]
Description=modifications mac for %I
Wants=network.goal
Before=network.goal
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device

[Service]
Type=oneshot
ExecStart=/usr/bin/macchanger -r %I
StayAfterExit=sure

[Install]
WantedBy=multi-user.goal

In the above piece of code, a brand new MAC deal with is assigned to the network interface each time you boot your Linux pc. You can add a selected MAC deal with using the -m choice as a substitute of -r within the tenth line, as proven beneath:

ExecStart=/usr/bin/macchanger -m XX:XX:XX:XX:XX:XX %I

How to Change MAC Address in Linux

3. Next, all you should do is allow the service you simply created using the next command:

sudo systemctl allow changemac@<interface_name>.service

How to Change MAC Address in Linux

Now, you’re all set. Your Linux pc will mechanically change the MAC deal with (completely) to a brand new one each time you boot into a brand new session.

Frequently Asked Questions

Are MAC addresses everlasting?

Yes, MAC Addresses are everlasting and get assigned by the producer of the network device. But they are often modified using some tips within the Linux terminal, as proven above.

Do MAC addresses get reused?

Since the variety of obtainable MAC addresses is restricted, producers do must reuse the MAC addresses.

How lengthy is a MAC deal with?

A MAC deal with consists of 48 bits or 6 bytes, the place every byte consists of two hexadecimal digits. They are proven in units of two, separated by a colon or hyphen.

Modify the MAC Address in Linux

Changing the MAC deal with in Linux is straightforward and may help enhance your privacy and safety whereas using the Internet. While you should use the Terminal to switch the MAC deal with completely, notice that the steps may differ barely relying in your Linux distro. Further, whereas altering the MAC deal with in your Linux PC, be certain that it doesn’t battle with another MAC deal with, or else each addresses will get disconnected from the network. We hope this text helped you completely change your MAC deal with in your Linux PC. If you may have any questions, tell us within the feedback beneath.


Check out more article on – How-To tutorial and latest highlights on – Technical News


Tags: AddressChangeFix IssueFix Software IssuesFix Technical IssuesHow To FixHow To Fix IssueHow-To-9-How-ToLinuxMacMac OSmac os xMacOSMethodsTechnical Troubleshooting

Recommended.

6 Ways To Fix ROBLOX Error Code 267

6 Ways To Fix ROBLOX Error Code 267

January 10, 2023
How To Disable Incognito Mode In Chrome

How To Disable Incognito Mode In Chrome

December 21, 2022

Trending.

No Content Available
  • About
  • Advertise
  • Privacy & Policy
  • Contact
All about technical, android, mobile, windows relating website. We provide you with the latest technology straight from the industry.

© 2023 How To Fix Issue - All rights reserved.

No Result
View All Result
  • Home
  • Windows
    • Windows 10
    • Windows 11
  • Mac
  • iOS
  • iPad
  • iPhone
  • Social Media
  • News

© 2023 How To Fix Issue - All rights reserved.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
SAVE & ACCEPT
This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.
Go to mobile version