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
- Once you run the command, add the line
- The file should now look something like thisÃ‚Â
# File is autogenerated by Cloud-Init and will be recreated after each boot network: version: 2 ethernets: eth0: match: macaddress: 52:54:00:29:71:04 set-name: eth0 addresses: - 18.104.22.168/24 nameservers: addresses: [22.214.171.124, 126.96.36.199] mtu: 1400 routes: - scope: link to: 188.8.131.52/32 via: 0.0.0.0 - to: 0.0.0.0/0 via: 184.108.40.206 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.