歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux下MAC地址

Linux下MAC地址

日期:2017/2/28 16:11:27   编辑:Linux教程

本文主要介紹下修改MAC地址的方法。
#1,查看當前MAC地址,並且備份

查看當前MAC地址:

ifconfig | grep HWaddr

output:

eth0 Link encap:Ethernet HWaddr 00:19:48:2E:D1:2

00:19:48:2E:D1:2即是你的MAC地址,將其復制到一個文件中保存。

#2,以root權限修改MAC地址:

禁用eth0

ifdown eth0

修改MAC地址為00:E0:81:5C:B4:0F

ifconfig eth0 hw ether 00:E0:81:5C:B4:0F

生效修改:

ifconfig eth0 | grep HWaddr

提示,上述修改MAC地址只是暫時的。一旦重啟,系統會恢復原物理MAC地址。

How to change MAC address in Fedora
1. First step is to find the current MAC address and take a backup copy in a safe place.

To know your current MAC type:
$ ifconfig | grep HWaddr
eth0 Link encap:Ethernet HWaddr 00:19:48:2E:D1:27

The above hexadecimal numbers 00:19:48:2E:D1:27 is your MAC address for device eth0.
Simply copy and paste it in a file.

2. Now, time to change the MAC address this requires you to work as root user.
Take the network interface down
# ifdown eth0

Now, lets change the current MAC address to 00:E0:81:5C:B4:0F
# ifconfig eth0 hw ether 00:E0:81:5C:B4:0F

Take the network interface up again
# ifconfig eth0 up

Check if your MAC address is changed:
# ifconfig eth0 | grep HWaddr

Note:
Changing MAC address is only temporary. Once you reboot your machine, the operating system will reflect the physical MAC address burnt in your network card and not the MAC address you set.

Copyright © Linux教程網 All Rights Reserved