1、先停止桌面版自帶的NetworkManager,這東西很難用,且有些設置需要重啟。
sudo systemctl stop NetworkManager.service sudo systemctl disable NetworkManager.service
2、設置MAC地址在幫助文檔中應該找這個關鍵字:hardware address,設置有兩種方式,臨時和永久。
- 臨時,直接使用命令行方式,重啟后失效
sudo ifconfig eth0 down sudo ifconfig eth0 hw ether xx:xx:xx:xx sudo ifconfig eth0 up
- 永久,修改/etc/network/interfaces
#加入如下MAC地址配置 hwaddress ether 00:01:04:1b:2C:1F #重啟網絡服務 sudo service networking restart
3、網絡常用設置/etc/network/interfaces(IP/DNS/網關)
#This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface #環路 auto lo iface lo inet loopback # The primary network interface auto eth0 #網卡 iface eth0 inet static #設置IPV4為靜態地址 address 1.1.1.2 #設置IP netmask 255.255.255.0 #設置子網掩碼 network 1.1.1.255 #設置網關 gateway 1.1.1.1 #設置網關 dns-nameservers 1.1.1.1 #設置DNS服務器,多個用空格隔開 dns-search .com #限制.com的查詢走上面設置的DNS服務器 hwaddress ether 00:01:04:1b:2C:1F #設置MAC地址
參考:
http://blog.csdn.net/zhangwu1241/article/details/53311534
http://www.youritronics.com/how-to-set-the-mac-address-from-etcnetworkinterfaces-in-debian/
https://www.cnblogs.com/qiuxiangmuyu/p/6343841.html