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:  Gamebuntu 1.0 Released

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

Linux Kernel 5.9 Reaches End of Life: How To Upgrade To Linux Kernel 5.10 LTS Linux
Top 12 Best Backup Software For Linux In 2018 Top 12 Best Backup Software For Linux In 2018 Linux
Best Linux Operating Systems For Beginners In 2019 Best Linux Operating Systems For Beginners In 2019 Linux
Add Apt Repository In Ubuntu 22.04 LTS: Fix add-apt-repository command not found Add Apt Repository In Ubuntu 22.04 LTS: Fix add-apt-repository command not found Linux
Ubuntu Based Linux Rescue Distro Rescuezilla 1.0.6 Released Ubuntu Based Linux Rescue Distro Rescuezilla 1.0.6 Released Linux
22+ Best Lightweight Linux Operating Systems In 2023 22+ Best Lightweight Linux Operating Systems In 2023 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]
  • Senior Data Scientist, Product, Google Play

    • Mountain View, CA (Remote)
    • Google
    • Full Time
  • Senior Proposal Writer

    • Centreville, VA
    • Leidos
    • Full Time
  • Service Writer

    • Richfield, OH
    • W.W. Williams
    • Full Time
  • Senior Technical Writer

    • Swiftwater, PA
    • Aequor
    • Full Time
  • Technical Writer

    • Pittsburgh, PA
    • The HIRD
    • Full Time
  • Technical Writer II (Swiftwater)

    • Swiftwater, PA
    • HireTalent - Staffing & Recruiting Firm
    • Part Time
  • Video Photojournalist

    • Washington DC
    • NTD
    • Full Time
  • Sr. Demand Writer (Costa Mesa)

    • Costa Mesa, CA
    • The Law Offices of Daniel Kim
    • Part Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme