ubuntu配置IP地址


使用ubuntu 16.04 server版本
ubuntu server版本只用這個文件作為網卡配置。
1、編輯網卡文件
sudo vim /etc/network/interfaces

2、添加參數
動態:
auto eth0
iface eth0 inet dhcp
靜態:
auto eth0
iface eth0 inet static
address 192.168.199.61
netmask 255.255.255.0
gateway 192.168.199.1
dns-nameservers 114.114.114.114
#pre-up ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx(要改成的MAC)
#從udev中查看

3、服務重啟
sudo /etc/init.d/networking restart

4、ping dns測試
ping 114.114.114.114


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM