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:  Wget Command Examples In Linux

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

Download NVIDIA 510.47.03 Graphics Driver For Linux Download NVIDIA 510.47.03 Graphics Driver For Linux Linux
OBS Linux 2023 Install OBS In Linux Operating System [2023] Linux
How To Install Ubuntu Studio DE On Ubuntu 22.04 LTS How To Install Ubuntu Studio DE On Ubuntu 22.04 LTS Linux
Must Have Apps For New Linux Users In 2020 Must Have Apps For New Linux Users In 2020 Linux
Vim Tutorials Learn VIM: VIM Tutorials For Beginners Linux
Install Squid Proxy on CentOS 7 Install Squid Proxy on CentOS 7 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]
  • Azure Architect

    • Kansas City, MO
    • Core Catalysts, Llc
    • Full Time
  • Systems Engineer II – Systems Design Architecture Effectors

    • Tucson, AZ
    • Raytheon
    • Full Time
  • Technical Writer

    • Hemlock, MI
    • Compunnel Inc.
    • Full Time
  • Technical Writer

    • Milwaukee, WI
    • Codeworks IT Careers
    • Part Time
  • Aftermarket Engineering Data Engineer

    • North Carolina (Remote)
    • Trane Technologies
    • Full Time
  • Automotive Service Advisor / Service Writer – Highland Park, IL

    • Highland Park, IL
    • GreatWater Garages
    • Full Time
  • Architect, Enterprise Lab Services and Operations Architect

    • Austin, TX
    • Dell
    • Internship
  • Architect, DevOps and Emerging Technology Strategy

    • Hopkinton, MA
    • Dell
    • Internship

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme