linuxmac地址修改
❶ linux修改mac地址命令
1.临时性的修改:
①依次输入以下命令:
/sbin/ifconfig eth0 down/sbin/ifconfig eth0 hw ether 00:0C:29:36:97:20/sbin/ifconfig eth0 upservice network restart
2.永久性的修改:
方法①:
并把类似于1中的②脚本保存在/etc/rc.local中:这一步是起作用的关键步骤
脚本如下:
/sbin/ifconfig eth0 down/sbin/ifconfig eth0 hw ether 00:0C:29:36:97:20/sbin/ifconfig eth0 upservice network restart
方法②:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
添加
MACADDR=00:0C:29:36:97:20
- :wq
- pre-up ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx(要改成的MAC)
- sudo nano /etc/network/interfaces
- face eth0 inet staticpre-up ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx(要改成的MAC)address 192.168.1.10netmask 255.255.255.0gateway 192.168.1.1
- sudo /etc/init.d/networking restart
注释掉原来的HWADDR
保存退出。
方法③:
直接编辑 /etc/network/interfaces 文件,在 iface eth0 inet static 后面添加一行:
编辑interfaces文件
如下所示:
重启网卡
注:MAC地址由udev在系统启动时探测网卡并加载,可在以下两个文件中反映出来
/sys/class/net/eth0/address 《Linux就该这么学》 一起学习linx
/etc/udev/rules.d/70-persistent-net.rules —-修改无效,根据硬件自动生成的文件
不过,用ifconfig修改了mac后,
/sys/class/net/eth0/address 的值随即跟着变了;但 /etc/udev/rules.d/70-persistent-net.rules 却没有变,只有在udev探测到硬件发生变化时才会修改这个文件。
❷ linux修改Mac地址
1、临时性的修改:
依次输入以下命令:
/sbin/ifconfig eth0 down
/sbin/ifconfig eth0 hw ether 00:0C:29:36:97:20
/sbin/ifconfig eth0 up
service network restart
2、永久性的修改:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
添加MACADDR=00:0C:29:36:97:20
注释掉原来的HWADDR
:wq 保存退出。
有危害,如果永久激活步骤错误则会造成无法联网的问题。
(2)linuxmac地址修改扩展阅读:
误区
#ifconfig eth0 down /*禁掉eth0网卡,这里以eth0网卡为例*/
#ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE/*修改eth0网卡的MAC地址*/
#ifconfig eth0 up /*重新启动eth0网卡*/
然后重新启动主机。
结论:按照这种方法修改MAC地址,重新启动主机系统后,MAC地址会自动还原。
❸ Linux中MAC地址问题
linux想修改系统中的MAC地址(例如改为0004a2d2e212),操作方法是:用#ifconfig eth0 down 先把网卡禁用,否则会报告系统忙,无法更改;然后再用ifconfig eth0 hw ether 0004a2d2e212即可。 (此方法只适用即时的,重启后会恢复为默认的网卡MAC地址)
如果你想永久修改系统中的MAC地址,即让linux重启后也是修改后的MAC地址,可以这样操作:在/etc/rc.d/rc.local中加入以下三行(也可在/etc/init.d/network中添加以下三行)
ifconfig eth0 down
ifconfig eth0 hw ether 0004a2d2e212
ifconfig eth0 up
★、查看Linux中MAC地址是否改好
方法:可以这样操作:重启电脑,在终端下,输入IPconfig/all命令,于是Physical Address就会显示一个地址,你检查一下即可得知MAC是否修改成功了。
❹ 怎样修改linux mac地址
方法一:
1.关闭网卡设备
ifconfig eth0 down
2.修改MAC地址
ifconfig eth0 hw ether MAC地址
❺ 如何修改linux虚拟机的mac地址
1.用命令行临时解决:
#sudo
ifconfig
eth0
down
#sudo
ifconfig
eth0
hw
ether
AA:BB:CC:DD:EE:FF
#sudo
ifconfig
eth0
up
2.启动自行修改
#sudo
vi
/etc/network/interfaces
在eth0的配置中加入如下
hwaddress
ether
AA:BB:CC:DD:EE:FF
❻ Linux中MAC地址问题
linux想修改系统中的MAC地址(例如改为0004a2d2e212),操作方法是:用#ifconfig
eth0
down
先把网卡禁用,否则会报告系统忙,无法更改;然后再用ifconfig
eth0
hw
ether
0004a2d2e212即可。
(此方法只适用即时的,重启后会恢复为默认的网卡MAC地址)
如果你想永久修改系统中的MAC地址,即让linux重启后也是修改后的MAC地址,可以这样操作:在/etc/rc.d/rc.local中加入以下三行(也可在/etc/init.d/network中添加以下三行)
ifconfig
eth0
down
ifconfig
eth0
hw
ether
0004a2d2e212
ifconfig
eth0
up
★、查看Linux中MAC地址是否改好
方法:可以这样操作:重启电脑,在终端下,输入IPconfig/all命令,于是Physical
Address就会显示一个地址,你检查一下即可得知MAC是否修改成功了。
❼ Linux中如何更改MAC地址
我们为什么要更改MAC地址,也许你不希望你的实际MAC地址(物理地址)暴露在公共网络上。另一种情况是,网络管理员可能在网络设备中阻止了一个特定的MAC地址。
环境
Centos 7.7 Minimal
GNU MAC changer 1.7.0
查询网卡和MAC地址
[root@localhost ~]# ip link show1: lo:mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:002: 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
网卡名称是ens33,MAC地址是00:0c:29:48:4c:9a。请记下自己的MAC地址,稍后做完实验恢复到原来的MAC地址。
使用macchanger工具更改MAC地址
Macchanger可以查看、修改MAC地址。
安装macchanger
[root@localhost ~]# git clone https://github.com/alobbs/macchanger
[root@localhost ~]# yum -y install autoconf automake gcc gcc-c++ texinfo
如何使用macchanger
使用下面的 命令 生成一个随机的mac地址为ens33网卡:
[root@localhost ~]# macchanger -r ens33
Current 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)
查看一下ens33的MAC地址是否改变了
[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
可以更改成一个自己指定的mac地址,使用下面的 命令 更改:
[root@localhost ~]# macchanger --mac=XX:XX:XX:XX:XX:XX
如果想要恢复到真实的MAC地址,请使用下面的命令:
[root@localhost ~]# macchanger -p ens33
Current 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.)
总结
我们为什么要更改MAC地址,也许你不希望你的实际MAC地址(物理地址)暴露在公共网络上。另一种情况是,网络管理员可能在网络设备中阻止了一个特定的MAC地址。
❽ linux系统怎么修改网卡物理地址
使用Win7MAC地址修改工具
1,只适用于windows7系统的网卡MAC地址修改。XP的可以用,但没做什么测试。
2,部分windows7下的无线网卡地址无法修改,理论上也可以使用本软件修改。
3,修改MAC地址前,请先在开始菜单-运行,输入cmd打开控制台,输入getmac获取原来网卡MAC并记下来,用于以后可以改回来。
4,软件使用方法很简单,只需在下拉列表选择所要修改的网卡,然后在文本框里面输入一个新的MAC地址,比如EF2d32BC6525(注意不要加横杠),然后点击修改按钮即可修改。
❾ linux修改Mac地址
有三种方法: 方法一: 1.关闭网卡设备 ifconfig eth0 down 2.修改MAC地址 ifconfig eth0 hw ether MAC地址 3.重启网卡 ifconfig eth0 up 方法二: 以上方法一修改后linux重启后MAC又恢复为原来的,为了下次启动时修改后的MAC仍有效,我们可以修改文件file:/etc/rc.d/rc.sysinit(RedFlag Linux为这个文件,其他版本的linux应该不同)的内容,在该文件末尾加以下内容: ifconfig eth0 down ifconfig eth0 hw ether MAC地址 ifconfig eth0 up 方法三: 很简单的,只是在./etc/sysconfig/network-scripts/ifcfg-eth0中加入下面一句话: MACADDR=00:AA:BB:CC:DD:EE
❿ linux修改Mac地址
有三种方法:
方法一:
1.关闭网卡设备
ifconfig eth0 down
2.修改MAC地址
ifconfig eth0 hw ether MAC地址
3.重启网卡
ifconfig eth0 up
方法二:
以上方法一修改后linux重启后MAC又恢复为原来的,为了下次启动时修改后的MAC仍有效,我们可以修改文件file:/etc/rc.d/rc.sysinit(RedFlag Linux为这个文件,其他版本的linux应该不同)的内容,在该文件末尾加以下内容:
ifconfig eth0 down
ifconfig eth0 hw ether MAC地址
ifconfig eth0 up
方法三:
很简单的,只是在./etc/sysconfig/network-scripts/ifcfg-eth0中加入下面一句话:
MACADDR=00:AA:BB:CC:DD:EE
系统学习Linux,详情参考《Linux就该这么学》。