Skip to content
Technology News Information & Jobs

Technology News Information & Jobs

Ubuntu Tutorials, Ubuntu How To , Linux Tips, Tech Jobs

  • Work with US
  • Search Jobs
  • Post a Job
  • Contact Us
  • Ubuntu
    • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • Themes
  • Linux
  • Laptops
  • Tutorials
  • Job Dashboard
  • Toggle search form
How To Change MAC Address in Linux

How To Change MAC Address in Linux

Posted on March 7, 2023 By admin

How To Change MAC Address in Linux

In this Linux tutorial post, we will show you the step-by-step guide to changing MAC address in Linux based operating system.

How To Change MAC Address in Linux

We need to install tools to change MAC addresses in Linux. Run the following command to install macchanger and net-tools packages.

For CentOS-based systems:

sudo yum install macchanger net-tools

For Arch-based systems, use the following command:

sudo pacman -S macchanger net-tools

sudo apt install macchanger net-tools

We will show you two methods to change the MAC address in Linux-based operating systems.

Method 1:

Change the MAC Address In Linux Permanently

First, run the following command to list all the network devices in Linux and you also need to note down the interface name using the following command:
ifconfig

Run the following command to see the current MAC address of the network interface:
sudo macchanger --show <interface_name>

Run the macchanger tool with the following command to change the MAC address permanently:
>sudo macchanger -r <interface_name>

If you want to assign a particular MAC address in Linux then run the following command by specifying the MAC address.
sudo macchanger --mac=<mac_address> <interface_name>

Create a /etc/systemd/system/[email protected] systemd file so that you can get a new MAC address each time you boot into the system.
sudo vim /etc/systemd/system/[email protected]

Then, paste the following text inside the [email protected] file:

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

[Service]
Type=oneshot
ExecStart=/usr/bin/macchanger -r %I
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Now, run the following command to enable the service:
sudo systemctl enable changemac@<interface_name>.service

How to Change the MAC Address Temporarily In Linux

First, run the following command to list all the network devices in Linux :
ifconfig

Now, run the following command to disable the device’s connection to the network to change its MAC address in Linux.

READ More Relevant Stuff:  Linux Kernel 5.9 Reaches End of Life: How To Upgrade To Linux Kernel 5.10 LTS

sudo ifconfig <interface_name> down

sudo ip link set dev <interface_name> down

Use the following command to change the MAC address in Linux.

sudo ifconfig <interface_name> down hw ether <new_mac_address>

Run the following command to enable the device.

sudo ifconfig <interface_name> up

Linux

Post navigation

Previous Post: MSI Titan GT77 HX 13V Vs Razer Blade 16 Early 2023
Next Post: 5 Best Power Banks for Steam Deck [2023]

Related Posts

Some Of The Linux Boot Loaders Some Of The Linux Boot Loaders Linux
Linux kernel 5.0 released Linux Kernel 5.0 Released | Download Now Linux
How To Upgrade To Linux Mint 20.2 | Easy Method How To Upgrade To Linux Mint 20.2 | Easy Method Linux
Top 9 Best Photoshop Alternatives For Linux Top 9 Best Photoshop Alternatives For Linux For 2023 Ubuntu
Run Linux On Windows 11: Install Linux Bash Shell on Windows 11 Run Linux On Windows 11: Install Linux Bash Shell on Windows 11 How To Ubuntu
HPLIP 3.22.4 Released | HP printer and scanner drivers For Linux HPLIP 3.22.4 Released | HP printer and scanner drivers For Linux Linux

Recent Posts

  • New Job Search October 10, 2025
  • How To Enable Hibernate in Ubuntu 22.04 LTS May 20, 2024
  • Popular Ubuntu Games: Top 5 Games To Play March 17, 2024
  • WordPress | Your site doesn’t include support for the “generateblocks/container” block GenerateBlocks Plugin February 11, 2024
  • Ubuntu Autoremove Command Debian Autoremove Command February 10, 2024
  • How To Mount Windows 11 Shares on Debian Linux December 7, 2023
  • Anonymous Browsing 101: A Deep Dive Into Residential Proxies November 20, 2023
  • How To Correctly Install Uninstall Linux Ubuntu Nvidia Drivers Fast October 31, 2023
  • Ethical Web Design: The Dos and Don’ts October 28, 2023
  • Understanding the Role of Security Operations Center October 25, 2023
  • The Positive Effects of AI Tools and Online Services on Students Successful Essay-Writing Skills October 3, 2023

Categories

  • Android
  • Apple
  • Blogs
  • Debian
  • Fix
  • Gadgets
  • Game
  • Google
  • How To Ubuntu
  • Internet
  • Laptops
  • Linux
  • Linux Commands
  • Linux Game
  • Linux Mint
  • News
  • Operating Systems
  • Security
  • Technology
  • Themes
  • Tools
  • Tutorials
  • Ubuntu
  • ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • Windows 11
  • Wordpress
  • Search Jobs
  • Post a Job
  • Job Dashboard
  • Contact Us
  • About US
  • Cookie Policy
  • Terms and Conditions
  • Privacy Policy
  • Sitemap
  • Write For US

Tags

android apps centos ChatGPT command Commands Debian deepin Desktop docker Fedora fix game games Gaming gnome google kernel linux linux commands linux kernel Linux laptops Linux Mint Linux themes minecraft NVIDIA Python Raspberry Pi sysadmin themes ubuntu ubuntu 18.04 Ubuntu 18.04 LTS Ubuntu 20.04 ubuntu 20.04 lts Ubuntu 22.04 LTS Ubuntu games Ubuntu kernel ubuntu themes ubuntu tutorial VirtualBox Windows Windows 11 Wine WSL
itsubuntu.com is an Equal Opportunity Employer. For Advertisement, Jobs, Guest posts, and any other thoughts, email us at [email protected]
  • Artificial Intelligence / Machine Learning Engineer with Poly (AI/ML2)

    • Annapolis Junction, MD
    • Lockheed Martin
    • Full Time
  • YouTube Video Creator & Product Review Writer (LA 3 days in office) (El Segundo)

    • El Segundo, CA
    • eNNOVATION Brands
    • Part Time
  • Senior Reporter/ Writer

    • Norco, CA
    • JSL TECHNOLOGIES INCORPORATED
    • Full Time
  • Automotive Service Writer

    • Carson, CA
    • Midas
    • Full Time
  • Software Engineer with Poly Mid to SR (SWE2) DevOps

    • Annapolis Junction, MD
    • Lockheed Martin
    • Full Time
  • Data Engineer

    • Cleveland, OH (Remote)
    • Qode
    • Full Time
  • Service Writer

    • Livermore, CA
    • Livermore Ford
    • Full Time
  • Senior Process Engineer

    • Green Bay, WI
    • Suominen Green Bay Nonwovens
    • Full Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme