ubuntu16.04设置静态IP地址
和以前的版本有点不同。
照下面修改 /etc/network/interfaces 现在DNS也写在里面。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto enp0s3 #iface enp0s3 inet dhcp iface enp0s3 inet static address 192.168.11.2 netmask 255.255.255.0 gateway 192.168.11.1 dns-nameserver 192.168.11.1 |