在linux下我们经常需要折腾一下,干一些“坏事”,那么修改mac地址就必须懂了。下面我们简单介绍一下linux下修改网卡 MAC 地址的方法 (#后面为注释)
sudo ifconfig eth0 down #关闭网卡
sudo ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE #改地址
sudo ifconfig eth0 up #然后启动网卡
永久改地址方法
sudo gedit /etc/network/interfaces
在 iface eth0 inet static 后面添加一行:
pre-up ifconfig eth0 hw ether 01:01:01:01:01:01
配置文件应该像如下
iface eth0 inet static
pre-up ifconfig eth0 hw ether 01:01:01:01:01:01
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
然后logout 和 reboot