ubuntu 16.04下靜態IP地址的設置ubuntu
找到文件並做以下修改:
sudo vim /etc/network/interfacesvim
auto lo
iface lo inet loopback
auto enp2s0
iface enp2s0 inet static
address 192.168.20.1
netmask 255.255.255.0
gateway 192.168.20.254oop
dns-nameserver 8.8.8.8rest
sudo /etc/init.d/networking restartserver
auto eth0 #設置自動啓動eth0接口
iface eth0 inet static #配置靜態IP
address 192.168.11.88 #IP地址
netmask 255.255.255.0 #子網掩碼
gateway 192.168.11.1 #默認網關dns