Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify MAC address in Linux system

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to modify the MAC address in the Linux system, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Environment Centos7.7 MinimalGNU MAC changer 1.7.0 query the network card and MAC address [root@localhost ~] # ip link show1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 0000 qdisc pfifo_fast state UP mode DEFAULT group default qlen 0000lv 0000lv 0000lv 0000 brd 00lv 0000lv 0000lv 0000lv: ens33: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 00:0c:29:48:4c:9a brd ff:ff:ff:ff:ff:ff

The name of the network card is ens33,MAC and the address is 00:0c:29:48:4c:9a. Please write down your MAC address and restore it to the original MAC address after the experiment.

Use the macchanger tool to change the MAC address

Macchanger can view and modify MAC addresses.

Install Macchanger [root @ localhost ~] # git clone https://github.com/alobbs/macchanger[root@localhost ~] # yum-y install autoconf automake gcc gcc-c++ texinfo how to use macchanger

Use the following command to generate a random mac address for the ens33 Nic:

[root@localhost] # macchanger-r ens33Current MAC: 00:0c:29:48:4c:9a (VMware, Inc.) Permanent MAC: 00:0c:29:48:4c:9a (VMware, Inc.) New MAC: a2:97:a2:55:53:be (unknown)

Check to see if the MAC address of ens33 has changed

[root@localhost ~] # ip link show ens332: ens33: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether a2:97:a2:55:53:be brd ff:ff:ff:ff:ff:ff

You can change it to a self-specified mac address, using the following command:

[root@localhost] # macchanger-- mac=XX:XX:XX:XX:XX:XX

If you want to restore to the real MAC address, use the following command:

[root@localhost] # macchanger-p ens33Current MAC: a2:97:a2:55:53:be (unknown) Permanent MAC: 00:0c:29:48:4c:9a (VMware, Inc.) New MAC: 00:0c:29:48:4c:9a (VMware, Inc.) The above is all the contents of the article "how to change the MAC address in the Linux system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report