打印

修改MAC地址后不能上网的解决方法

0

修改MAC地址后不能上网的解决方法

首先 卸载网卡模块,模块名可以用lsmod 看到
ifconfig eth0 down
ifconfig lo down
rmmod tg3
再重新加载它
modprobe tg3
修改MAC地址
ifconfig eth0 hw ether xx:xx:xx::xx:xx:xx
看一下MAC地址 是不是 已经改变
ifconfig -a
重新加载网络设置
cd /etc/rc.d
./rc.inet1
./rc.inet2
./rc.inetd restart
这样就可以重新使用网卡上网了

其实在redhat里面不用这么麻烦,不用卸载再重新加载网卡模块,但是在执行
ifconfig eth0 hw ether xx:xx:xx::xx:xx:xx 之前 必须 ifconfig eth0 down,否则会
提示设备忙,slackware则没有这个提示,也不需要先ifconfig eth0 down,所以
我怀疑在redhat系统中,rmmod modprobe (或者有其它等效的方法) 是自动执行的。

既然从命令行能够实现,写成脚本,让系统启动时自动加载应该也没有问题。

其实这个方法很笨 ,估计执行了很多重复的没有必要的命令,水平所限,也只能做到这样。

TOP

0

回复 1楼 的帖子

感谢楼主个分享,我就去试试看拉。看你说的行不?

TOP

0
楼主,这是linux下面的命令吧。不懂,你这个是什么意思

TOP

当前时区 GMT+8, 现在时间是 2024-5-5 01:30