臨時修改
- 先停用網卡
- 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