ubuntu server 18 修改ip

#设置ip 注意要自己修改一下自己的ip


sudo \cp -f /etc/netplan/50-cloud-init.yaml /etc/netplan/50-cloud-init.yaml_bak_`date +"%Y年%m月%d日%H-%M-%S"`;
sudo echo  'network:
    ethernets:
        ens33:
                
            addresses: [192.168.1.32/24]
            dhcp4: false
            gateway4: 192.168.1.250
            nameservers:
                      addresses:
                              - 114.114.114.114
    version: 2' >/etc/netplan/50-cloud-init.yaml;
sudo netplan apply

 

 

你可能感兴趣的:(运维,linux运维)