Fresh snap install not listening on IPv4

I’m able to connect from my LAN but not from my WAN because my fw doesn’t pass IPv6 (and I don’t want it to). I’ve tried reinstalling and even rebuilding the VM from scratch (Ubuntu 20). What am I doing wrong? Or maybe, how do I enable IPv4 listening post-installation?

Here’s my command history
154 sudo snap install nextcloud
159 sudo nextcloud.manual-install nextcloud-user password
161 sudo nextcloud.occ config:system:set trusted_domains 1 --value=domain.us
163 sudo ufw status
164 sudo ufw show listening

Results:

sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
80/tcp                     ALLOW       Anywhere
443/tcp                    ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)
80/tcp (v6)                ALLOW       Anywhere (v6)
443/tcp (v6)               ALLOW       Anywhere (v6)
sudo ufw show listening
tcp:
  111 * (rpcbind)
  22 * (sshd)
   [ 1] allow OpenSSH

tcp6:
  111 * (rpcbind)
  22 * (sshd)
   [ 4] allow OpenSSH

  80 * (httpd)
   [ 5] allow 80/tcp

udp:
  111 * (rpcbind)
  5353 * (mdns-publisher)
udp6:
  111 * (rpcbind)
  5353 * (mdns-publisher)

Hello,

I am sorry, but if you are able to access from LAN, that means Nextcloud Snap is definitely listening on 80/443.

If same setup is working fine on LAN but not on WAN, I guess it’s something to do with your network setup or domain DNS setup.

Thanks.

What would it take for you to believe me? I added the ufw show listening result that shows it’s not listening.

Not sure what ufw show listening is supposed to show, but I can tell you for sure, that IPv4 is working, if you can access your Snap installation from LAN by using http://IPv4-address in a browser. A possible explanation why it only displays tcp6 can be found here… linux - netstat — why are IPv4 daemons listening to ports listed only in -A inet6? - Unix & Linux Stack Exchange

@bb77 and @NaXal are right, if you can reach it from your LAN the snap is working properly. Your problem is elsewhere.

That’s apache from the snap right there ^. It uses address mapping to translate ipv4.

2 Likes

@tonypags314
Maybe you can first deactivate ufw. And if it works you can plan to activate it again to exclude problems from ufw.

Thanks for clarifying that and for the link. I was banging my head for a while and thought I found a misconfiguration in the app stack. I ended up rebuilding, again, and it worked; I’m not sure what I did differently. It was likely something I didn’t do this time that I didn’t realize I did last time. If that makes sense.