一、設置靜態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