包括Ubuntu 18.04和18.10,设置为静态IP及DNS。
sudo vim /etc/netplan/50-cloud-init.yaml
network: ethernets: enp4s0: addresses: [192.168.1.15/24] //IP地址 gateway4: 192.168.1.1 //网关 nameservers: addresses: [114.114.114.114, 202.96.128.86] //DNS dhcp4: no optional: no version: 2
sudo netplan apply
原文地址:https://www.cnblogs.com/maluscalc/p/10612465.html
时间: 2024-11-13 09:46:39