linux系統設置靜態IP,DHCP網絡服務,DNS


一、設置靜態IP及DHCP網絡服務

kk@yuanqiangfei:~$ cat /etc/network/interfaces
# 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                                                #eth0網卡開機啟動
iface eth0 inet dhcp                                    #使用DHCP服務器申請動態IP
#iface eth0 inet static                                 #設置eth0網卡靜態IP
#address 192.168.1.188                               #靜態IP   
#netmask 255.255.255.0                               #掩碼
#gateway 192.168.1.1                                  #網關   

二、修改DNS 

kk@yuanqiangfei:~$ cat /etc/resolvconf/resolv.conf.d/base
nameserver 192.168.3.1
nameserver 192.168.1.1
kk@yuanqiangfei:~$ ^C
kk@yuanqiangfei:~$ resolvconf -u

查看修改是否成功: 

修改相關參數之后重啟網絡:

sudo service networking restart

  

 

  


免責聲明!

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



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