Ubuntu 18.04 设定静态 IP 地址
新建并编辑 /etc/netplan/01-netcfg.yaml
文件:
network:
version: 2
renderer: networkd
ethernets:
ens33:
dhcp4: no
addresses: [192.168.50.124/24]
gateway4: 192.168.50.1
nameservers:
addresses: [114.114.114.114]
重启即可。