更改linux下的网卡物理地址

有些地方是把网络地址和网卡物理地址绑定的,当换了网卡或其它电脑时可能会上不了网,下面介绍更改物理地址(MAC Address)的方法。分为临时更改和长期更改两种情况,两种方法均不实际改变网卡的真实属性。

临时更改
所谓临时更改,是指在重新启动系统后就失效的短期更改方法,较简单。

Linux网卡的物理地址设置是在网络设置时进行的。
首先确定你在使用root用户。假设对eth0进行设置。
先网卡“关闭”
# ifconfig eth0 down
更换物理地址,把粗体部分更换为你要换的MAC地址:
# ifconfig eth0 hw ether AA:BB:CC:DD:EE:FF
启用eth0。
# ifconfig eth0 up
如果需要,请自行添加加入路由的命令。
注意:
如果还要设置IP等其它信息,一定要把hw ether 物理地址紧跟在设备名(如eth0)后面。
长期更改
这里指重启后仍能保留更改。需要文本编辑器配置文件。

Debian(Ubuntu很可能也在此列)
编辑/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

注释的部分是静态IP的写法,当前的未注释的是动态IP的写法。详细信息请参见Debian网络设置

Archlinux或Gentoo
编辑/etc/rc.conf(Archlinux)或/etc/conf.d/net(Gentoo),在eth0配置的字符串中,在IP地址的前面加入 hw ether 00:AA:BB:CC:DD:EE。 Gentoo和Archlinux的网络设置,请参阅发行版的相关文档。

Fedora或Redhat
编辑/etc/sysconfig/network-scripts/ifcfg-eth0(如需要请修改eth0到你的网卡编号),加入或修改
HWADDR=AA:BB:CC:DD:EE:FF
即可。

电子科大的Ubuntu 源

推荐使用域名http://ubuntu.dormforce.net代替http://ubuntu.uestc.edu.cn

Ubuntu 8.10 Intrepid Ibex
deb http://ubuntu.uestc.edu.cn/ubuntu/ intrepid main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ intrepid main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-updates main restricted universe multiverse

Ubuntu 8.04 Hardy Heron
deb http://ubuntu.uestc.edu.cn/ubuntu/ hardy main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ hardy-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ hardy-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ hardy-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ hardy-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ hardy main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ hardy-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ hardy-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ hardy-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ hardy-updates main restricted universe multiverse

Ubuntu 7.10 Gutsy Gibbon
deb http://ubuntu.uestc.edu.cn/ubuntu/ gutsy main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ gutsy main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ gutsy-updates main restricted universe multiverse

Ubuntu 7.04 Feisty Fawn
deb http://ubuntu.uestc.edu.cn/ubuntu/ feisty main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ feisty-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ feisty-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ feisty-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ feisty-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ feisty main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ feisty-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ feisty-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ feisty-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ feisty-updates main restricted universe multiverse

学校?中介?

国家现在在大力扶持职业教育,当前的职业教育混乱不堪,各色人物都混于其中。国家是忽悠完了高中,忽悠大学,大学忽悠完了就开始忽悠各种职业学校了。现在的各类职业学校严格的实现了教育产业化的方针政策。
既然是产业,就要赚钱,各类职业学校以赚钱为目的蜂拥而至。原来比较好的那些中专学校在2000年前后那段折腾大学的时间里,升专的升专,垮台的垮台,没得几所是完好无损的活到现在的。当前搞职业教育的私立学校较多,不少都是以赚钱为目的的“中介”学校。说是“中介”并不为过,这些学校失去了学校教育培训的目的,而以安排工作为主,完全成为了“职业介绍所”。
不少职业学校的教育质量和教学设施实在是“没有最差,只有更差”。管他学生学得好坏,最终都是要出去打工的,有个工作安排给学生,他们就满足了。少数不满足的就自己再奋斗。
只希望国家对职业教育的调整早点到位,别让太多的人为之付出不该有的代价!