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 No Comments on How To Change MAC Address in Linux

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:  Virtualbox 6.0.12 Released | Install In Ubuntu

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

Virtualbox 6.0.12 Released | Install In Ubuntu Virtualbox 6.0.12 Released | Install In Ubuntu Linux
How To Install Java On RHEL 8: RedHat Tutorial How To Install Java On RHEL 8: RedHat Tutorial Linux
Server Monitoring Tools For Linux In 2020 Server Monitoring Tools For Linux In 2020 Linux
Rufus Alternatives For Linux In 2023 Best Rufus Alternatives For Linux In 2023 Linux
Top GUI Tools for Linux System Administrators Top GUI Tools for Linux System Administrators Linux
Ubuntu 20.10 Groovy Gorilla Download Ubuntu 20.10 “Groovy Gorilla” Beta Now Available For Download Linux

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • 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
  • Linux Wget Examples September 27, 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]
  • Prepared Foods Order Writer (Deli / Culinary – Buyer / Inventory Replenishment) – Full Time

    • Thayne, WY
    • Whole Foods Market
    • Full Time
  • Sr. Risk and Controls Compliance Policy Writer (on-site Phoenix, Chicago, San Fran)

    • San Francisco, CA
    • INSPYR Solutions
    • Full Time
  • Artificial Intelligence & Gen AI Engineer – Tampa, Hybrid

    • Tampa, FL
    • Citigroup Inc
    • Full Time
  • Sr. Technical Documentation Specialist – REMOTE

    • Atlanta, GA
    • HHS Technology Group, Inc.
    • Full Time
  • TECHNOLOGY VICE PRESIDENT, ARTIFICIAL INTELLIGENCE & MACHINE LEARNING AND DATA

    • Falls Church, VA
    • NLP PEOPLE
    • Full Time
  • Architectural Drafter

    • Sarasota, FL
    • Start To Finish Drafting
    • Full Time
  • Senior or Principal Data Scientist – Technical AI Ethicist

    • Seattle, WA (Remote)
    • salesforce.com, inc.
    • Full Time
  • Artificial Intelligence (AI) Data Scientist

    • Fairfax, VA
    • General Dynamics Information Technology
    • Full Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme