从Ubuntu 17.10开始网络工具变成了netplan,使用yaml文件配置,具体如下(这里是server版本,desktop版本还不知道):
1、路径
vi /etc/netplan/01-netcfg.yaml
2、内容
# This file describes the network interfaces available on your system # For more information, see netplan(5). network: version: 2 renderer: networkd ethernets: eno1: dhcp4: no addresses: [192.168.3.30/24] gateway4: 192.168.3.1 nameservers: addresses: [192.168.3.1, 1.1.1.1]
3、生效
netplan apply