Hi I have a fresh install of Ubuntu 18.04 server. I have installed the LAMP stack and Nextcloud. It is working well except I can not access the server remotely with firefox or ssh. On the LAN both work fine. I have port forwarding set up on my router the same as it was when the server was 14.4LTS. I tried forwarding port 2000 this worked fine with nc but not with ssh. I can ping the server. The server has a static LAN ip address and I am using no-ip ddns for a domain name. I have disabled the ufw firewall. When connected to external wifi and I enter the server url the connection times out. When I try to connect using ssh after a few seconds I get: "ssh_exchange_identification: read: Connection reset by peer" This version of Ubuntu came with netplan. From various posts I have set the contents of the /etc/netplan/50-cloud-init.yaml file to:

# renderer: networkd
        dhcp4: no
        dhcp6: no
        addresses: []
            addresses: [,]
  version: 2

The renderer is commented out as it stopped the file working also I read a post saying to comment out gateway4. I tried that but it stopped LAN connection. Any help would be appreciated.

  • 1
    netplan is very fussy about indentation and spacing. Renderer should be uncommented, and should be 2 spaces indented, as should everything else. Version 2 goes under renderer. Are you sure that enp2s0 is the correct name for your server's ethernet port? See netplan.io/examples for more info. Report back to @heynnema
    – heynnema
    Jan 7, 2019 at 21:50
  • I'm suggesting you not to use netplan at all but using networkd by creating network configs in /etc/systemd/network/ directory. To remove netplan, you should remove netplan and netplan.io packages. Also check the network interface names with 'ip link'. Then check port forwarding. Cause it seems you issue is not correctly configured ports in you router.
    – Gannet
    Jan 7, 2019 at 22:33
  • @Gannet netplan is a core technology in Ubuntu Server. Why would you recommend to remove it?
    – heynnema
    Jan 8, 2019 at 0:37
  • Bacause netplan not used in any other distros but only Ubuntu. This is only Ubuntu's thing. networkd is used in all systemd-based distros, so it is universal.
    – Gannet
    Jan 8, 2019 at 9:53

1 Answer 1


If you are getting a 'connection reset' message from your ssh client, it does not sound like you have a problem with the host networking configuration - i.e. your problem is most likely unrelated to netplan.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.