0

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:


 network:
# renderer: networkd
  ethernets:
    enp2s0:
        dhcp4: no
        dhcp6: no
        addresses: [192.168.1.12/24]
        gateway4: 192.168.1.1
        nameservers:
            addresses: [8.8.8.8,8.8.4.4]
  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 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 at 22:33
  • @Gannet netplan is a core technology in Ubuntu Server. Why would you recommend to remove it? – heynnema Jan 8 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 at 9:53
0

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.

https://unix.stackexchange.com/questions/151860/ssh-exchange-identification-read-connection-reset-by-peer

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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