linux环境下:
用root身份登录,在/etc/rc.d/rc.local里加上这三句
ifconfig eth0 down
ifconfig eth0 hw ether 00:0C:18:EF:FF:ED
ifconfig eth0 up
这样重新reboot后就不怕MAC复原了。
2. ifconfig命令(转载 )
ifconfig [Interface]
Interface是可选项,如果不加此项,则显示系统中所有网卡的信息。如果添加此选项则显示所指定的网卡信息
例如:ifconfig eth0
eth0 Link encap:Ethernet |
我们可以看到
第三行:UP(代表网卡开启状态)RUNNING(代表网卡的网线被接上)MULTICAST(支持组播)MTU:1500(最大传输单元):1500字节
第四、五行:接收、发送数据包情况统计
第七行:接收、发送数据字节数统计信息。
2、ifconfig 配置网卡
ifconfig eth0 192.168.0.1 netmask 255.255.255.0
ifconfig eth0:0 192.168.1.1 netmask 255.255.255.0
这时再用ifconifg命令查看,就可以看到两个网卡的信息了,分别为:eth0和eth0:0。若还想再增加IP,那网卡的命名就接着是:eth0:1、eth0:2...想要几个就填几个。ok!
ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
将网卡禁用
ifconfig eth0 down
将网卡启用
ifconfig eth0 up
转自http://hi.baidu.com/hzd2712/blog/item/251fc02a8f8170315243c153.html
因篇幅问题不能全部显示,请点此查看更多更全内容