在文件/etc/sysconfig/network-scripts/ifcfg-eth0 中增加一行类似如下 MACADDR=00:04:AC:33:1C:3B 答:MAC地址是网卡的物理地址,其实在Linux下也可更改MAC地址: 1)闭网卡设备 /sbin/ifconfig eth0 down 2)修改MAC地址 /sbin/ifconfig eth0 hw ether MAC地址 3)重启网卡 /sbin/ifconfig eth0 up Red Hat Linux下如何修改网卡MAC地址 OS版本:Red Hat Enterprise Linux AS4 核心:Kernel 2.6.9-42 网上有很多关于linux下修改MAC地址的方法,大多依葫芦画瓢,似乎都没验证过,达不到修改的目的。 经过我的详细测试,最终成功解决了这个问题。 误区一: #ifconfig eth0 down /*禁掉eth0网卡,这里以eth0网卡为例*/ #ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE /*修改eth0网卡的MAC地址*/ #ifconfig eth0 up /*重新启动eth0网卡*/ 然后重新启动主机。 结论:按照这种方法修改MAC地址,重新启动主机系统后,MAC地址会自动还原。 误区二: #ifconfig eth0 down #cd /etc/sysconfig/network-scripts #vi ifcfg-eth0 修改其中的"HWADDR=xx:xx:xx:xx:xx:xx" #ifconfig eth0 up #service network start 结论:按照这种方法修改MAC地址后将无法启用网络,会出现如下提示: “Bringing up interface eth0: Device eth0 has different MAC address than expected,ignoring.” 那么,在linux环境下如何保证修改后的MAC地址永久保存呢?正确的步骤如下: #ifconfig eth0 down #cd /etc/sysconfig/network-scripts #vi ifcfg-eth0 修改其中的"HWADDR=xx:xx:xx:xx:xx:xx"为"MACADDR=xx:xx:xx:xx:xx:xx" #ifconfig eth0 up #service network start 关键词:HWADDR和MACADDR是有区别的。