Ubuntu 18.04 server 网卡配置文件地址为:
/etc/netplan/50-cloud-init.yaml
1.修改网卡配置文件
sudo vi /etc/netplan/50-cloud-init.yaml
network:
ethernets:
ens33:
addresses: [192.168.1.20/24]
dhcp4: false
gateway4: 192.168.1.1
nameservers:
addresses: [192.168.1.1]
optional: true
version: 2
2.应用使其生效
sudo netplan apply
如果netplan apply命令执行失败
注释掉"version: 2"
Ubuntu 18.04 desktop 配置文件地址为:
/etc/NetworkManager/system-connections
配置方式同上
原帖地址:https://blog.csdn.net/mossan/article/details/80381679
网友评论