1)闭网卡设备
/sbin/ifconfig eth0 down
2)修改MAC地址
/sbin/ifconfig eth0 hw ether 00:50:56:C0:00:01
3)重启网卡
/sbin/ifconfig eth0 up
通过ifconfig可以看到修改已经生效,可是重启机器后又恢复成了原来得mac.
要想永久修改MAC
在/etc/rc.d/rc.local里加上这三句(也可以在/etc/init.d/network里加下面三行)
ifconfig eth0 down
ifconfig eth0 hw ether 00:50:56:C0:00:01
ifconfig eht0 up
然后reboot