Linux 下修改网卡MAC

Linux下修改MAC地址

只需进行三步

1.关闭网卡设备

ifconfig eth0 down

2.修改MAC地址

ifconfig eth0 hw ether MAC地址

3.重启网卡

ifconfig eth0 up

但是系统下次系统后,MAC又恢复原样了。


另种就是修改在network初始化之前运行的脚本,这样下次启动以后网卡MAC就不会变了

小红帽 是 /etc/rc.d /rc.sysinit 文件

ubuntu下 是在/etc/rc`runlevel | awk '{print $2}'`.d 里面的 S99rc.local 修改它


你可能感兴趣的:(linux,ubuntu,脚本,UP,NetWork)