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:  How To Upgrade To Xfce 4.18 on 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

List Of The Best Linux Distros For Laptops In 2019 List Of The Best Linux Distros For Laptops In 2019 Linux
Basic Linux Terminal Shortcuts Every User Must Know Basic Linux Terminal Shortcuts Every User Must Know [ Bash Commands] Linux
Install NVIDIA Drivers On Debian 11 Install NVIDIA Drivers On Debian 11 [Updated] Debian
Linux Kernel Linux Kernel 5.4 And 4.19 Will Be Supported For 6 Years Linux
Online Tools For Generating Cron Jobs For Linux Online Tools For Generating Cron Jobs For Linux Linux
How To Install Viber On Ubuntu 18.04 LTS Bionic Beaver Tutorials

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]
  • UX Writer

    • Jersey City, NJ
    • Audible
    • Full Time
  • CoxHealth Sr. Data Architect II

    • Springfield, MO
    • CoxHealth
    • Full Time
  • Platform Architect

    • San Francisco, CA
    • JazzX AI
    • Full Time
  • Senior Architect, AI Solutions Engineering

    • Santa Clara, CA
    • NVIDIA
    • Full Time
  • Datatbase architect

    • Pleasanton, CA
    • Raas Infotek
    • Full Time
  • Azure DevOps Engineer

    • San Francisco, CA
    • Keturah konstellations : Global Workforce Solutions
    • Full Time
  • Senior Technical Program Manager, Audible Information Security and Security Engineering

    • Hoboken, NJ (Remote)
    • Audible
    • Full Time
  • Data Scientist

    • Silver Spring, MD
    • Leidos
    • Full Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme