临时修改
- 先停用网卡
- ifconfig eth0 down
- 修改网卡地址
- ifconfig eth0 hw ether **:**:**:**:**:**
- 启用网卡
- ifconfig eth0 down
永久修改
- 直接编辑 /etc/network/interfaces 文件,在 iface eth0 inet static 后面添加一行:
- pre-up ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx(要改成的MAC)
- 编辑interfaces文件
- sudo nano /etc/network/interfaces
- 如下所示:
- face eth0 inet static
- pre-up ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx(要改成的MAC)
- address 192.168.1.10
- netmask 255.255.255.0
- gateway 192.168.1.1
- 重启网卡
- sudo /etc/init.d/networking restart
转载于:https://blog.51cto.com/344924008/463562