1. 程式人生 > >舊文-ubuntu linux 8.04下修改mac地址-2008年12月17日 19:33

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

上網 改mac 編輯 地址 rdquo 搜索 oca 實驗 onf

因公司內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可以。

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