1. 配置靜態IP地址
# nano /etc/network/interfaces
auto lo
iface lo inet loopback
#The primary network interface
iface eth0 inet static
address 192.168.1.xxx
netmask 255.255.255.0
gateway 192.168.1.x
...
2. 設置DNS服務器
# nano /etc/resolvconf/resolv.conf.d/base
添加一下兩行:
nameserver 192.168.1.x
nameserver 8.8.8.8
3. 重啟網絡
# /etc/init.d/networking restart