How to fix the network error while connecting to your VPS after a restart.

Login using the VNC button

If using Ubuntu 18+ run the following command

nano /etc/netplan/50-cloud-init.yaml​

Once you run the command, add the line

on-link: true​

The file should now look something like this

# File is autogenerated by Cloud-Init and will be recreated after each bootnetwork: version: 2 ethernets: eth0: match: macaddress: 52:54:00:29:71:04 set-name: eth0 addresses: - nameservers: addresses: [,] mtu: 1400 routes: - scope: link to: via: - to: via: on-link: true​

You can see the new line at the bottom.

Once you do this save the file and restart the VPS. It should now have a network connection.
Была ли эта статья полезна?