旧文-ubuntu linux 8.04下修改mac地址-2008年12月17日 19:33

  因公司内IP与MAC绑定,且不能人人上网,只能通过更改MAC来上网。经搜索,有以下方法:
1,
直接编辑/etc/network/interfaces文件,在if ace eth0 inet static后面添加一行:
pre-up ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx(要改成的MAC)
2,
打开文件:/etc/iftab
修改内容:
eth0 mac 00:e0:4d:75:8e:50(改成你要的物理地址mac)
3,
先网卡“关闭” 
# ifconfig eth0 down
更换物理地址,把粗体部分更换为你要换的MAC地址: 
# ifconfig eth0 hw ether AA:BB:CC:DD:EE:FF
启用eth0。 
 # ifconfig eth0 up
重启网络服务
sudo /etc/init.d/networking restart
该方法只能临时修改。
4,
编辑/etc/network/interfaces,找到与eth0有关的地方,修改到形如: 
allow-hotplug eth0
iface eth0 inet dhcp
#iface eth0 inet static
#   address 1.1.1.6
#   netmask 255.255.255.0
#   gateway 1.1.1.1
     hwaddress ether 00:AA:BB:CC:DD:EE
经实验,这个方法好像不行。
5,
修改/etc/rc.local文件
sudo /sbin/ifconfig eth0 down
sudo /sbin/ifconfig eth0 hw ether 00:14:2a:34:4e:43
sudo /sbin/ifconfig eth0 up


我只实验了第4,5个方法,4不行,5可以。

posted on 2017-06-29 17:54  fishhead  阅读(165)  评论(0编辑  收藏  举报

导航