ubuntu 设置静态 IP
-
找到并打开配置文件
sudo vi /etc/network/interface -
编辑该文件
auto lo iface lo inet loopback auto enp0s17 // 默认是 dhcp,将其修改为 static iface enp0s17 inet static // 指定 IP 固定的 IP 地址 address 192.168.56.110 // 指定子网掩码 netmask 255.255.255.0 // 指定网关 gateway 192.168.56.1 // 指定 dns 域名解析服务器 dns-nameservers 114.114.114.114 -
重启网络
sudo service networking restart sudo /etc/init.d/networking restart
浙公网安备 33010602011771号