LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1040|回复: 5

debian下如何改网卡的mac地址

[复制链接]
发表于 2006-3-6 17:18:06 | 显示全部楼层 |阅读模式
还有网络配置更改后,如何重起网络?
谢谢
发表于 2006-3-6 17:42:12 | 显示全部楼层

试试这个

给用root用户
#ifconfig eth0 down
#ifconfig eth0 hw ether  XXXXXXXXXXXXXX(这个换成你的mac地址)
#ifconfig eth0 up
#/etc/init.d/networking  restart
(或者、#/etc/init.d/networking stop
         #/etc/init.d/networking  start
现在应该事可以了(要是您有多个网卡,把eth0改成您要改的eth#就可以了)
试试吧
回复 支持 反对

使用道具 举报

发表于 2006-3-6 22:24:08 | 显示全部楼层
不用,在debian下直接改/etc/network/interfaces就可以
auto eth0
        iface eth0 inet static
        address xxx.xxx.xxx.xxx
        hwaddress ether xx:xx:xx:xx:xx:xx (需要改成的MAC地址)
        netmask 255.255.255.0
        gateway xxx.xxx.xxx.xxx
回复 支持 反对

使用道具 举报

发表于 2006-3-6 22:25:18 | 显示全部楼层
重启网络是:
/etc/init.d/networking restart
回复 支持 反对

使用道具 举报

发表于 2006-3-7 12:20:07 | 显示全部楼层

不错呀

如果你是想每次重启都改的话直接用楼上朋友的方法就可以,或用我的方法作一个脚本,让它开机启动
如果你只是想偶尔改改就用我的方法吧,不需要每次改过来改过去
回复 支持 反对

使用道具 举报

发表于 2006-3-7 16:51:10 | 显示全部楼层
Post by liatler
给用root用户
#ifconfig eth0 down
#ifconfig eth0 hw ether  XXXXXXXXXXXXXX(这个换成你的mac地址)
#ifconfig eth0 up
#/etc/init.d/networking  restart
(或者、#/etc/init.d/networking stop
         #/etc/init.d/networking  start
现在应该事可以了(要是您有多个网卡,把eth0改成您要改的eth#就可以了)
试试吧


这样运行以后,下次重启后仍然是这个MAC,不需要做脚本再在开机时运行。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表