ubuntu 16.04配置静态ip 发表于 2020-01-03 更新于 2024-11-09 分类于 ubuntu 步骤:1、修改网络配置文件 1sudo vim /etc/network/interfaces 2、注释掉dhcp,添加静态ip 12345678#The primary network interfaceauto enp9s0#iface enp9s0 inet dhcp iface enp9s0 inet staticaddress 192.168.2.105netmask 255.255.255.0gateway 192.168.2.1dns-nameservers 8.8.8.8 若是配置完静态ip后无法解析服务器,则需要添加最后的dns-nameserver,此地址控制/etc/resov.conf中nameserver的地址,重启后生效。