VPS offline after restart

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


  1. Login using the VNC button
  2. If using Ubuntu 18+ run the following command
    nano /etc/netplan/50-cloud-init.yaml​
  3. Once you run the command, add the line
    on-link: true​
  4. 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:
          - 51.158.47.157/24
          nameservers:
            addresses: [8.8.8.8, 8.8.4.4]
          mtu: 1400
          routes:
          - scope: link
            to: 163.172.21.84/32
            via: 0.0.0.0
          - to: 0.0.0.0/0
            via: 163.172.21.84
            on-link: true​
  5. 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.


Was this article helpful?

mood_bad Dislike 0
mood Like 1
visibility Views: 663