Nextcloud not available from external via Wifi/Router but via 4G from mobile

Nextcloud version (eg, 18.0.2): 18.0.7
Operating system and version (eg, Ubuntu 20.04): nextcloudpi
Apache or nginx version (eg, Apache 2.4.25): need to check
PHP version (eg, 7.1): 7.3.14

The issue you are facing:
Form time to time, the website is unavailable from wifi connection. If I try to access huberconsulting.ddns.net form my laptop, it will show up a message saying “site could not be reached - response took to long” [ERR_CONNECTION_TIMED_OUT] and some DNS statement. But this seems to be something with my router, since the website is available, if I try to connect from my phone by using 4G.
It wasn’t working with my old router. Now I changed the router to a FritzBox 7590 but it still is not working. I assume it is something with DNS resolution.
I use no-ip as a DNS partner, but since the website is there via 4G it rather is something with my local network.

Is this the first time you’ve seen this error? (Y/N):

No, going on for a few weeks now.

Steps to replicate it:

  1. Access huberconsulting.ddns.net
  2. From time to time, website unavailable

The output of your Nextcloud log in Admin > Logging:

Nothing relevant - only a failed user login.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

Need to check once at home

The output of your Apache/nginx/system log in /var/log/____:

Need to check once at home

Most likely you try to access Nextcloud from your LAN using your external DNS name. This usually couldn’t work, because your FB is used as a simple local DNS and DNS forwarder to the internet. Due to the fact that the DNS name is a non-local one, your request is sent to the internet, resolved to your external ip address which is unreachable from your LAN because it points to the external ip of your router. A remapping to a local ip address is not possible.

Afaik, it won’t be possible to solved this problem by installing a local DNS server to remap the ip address, because this only works with 2nd-level domains. But it might be possible to add a static entry to your local hosts file on each client.

Hi @j-ed,

thanks for your quick reply. I am aware about this situation and I solved it for DNS resolution if I am at home. It works fine from home. But let me maybe explain the setup a little more in detail. Maybe I was not clear enough.

I have the Raspi located at home with the nextcloupi installed on it and running. FB (6590) has a static IPv4 which is linked to a domain via No-IP DNS resolution. If I access at home the domain, it works since I have corrected the hosts/rebind in the FB. Also via IP it works - of course - at home.

If I am in the office of my wife - same city but other location and separate internet access with FB 7590 and connected via wifi - the cloud works most of the time, but from time to time it does not and the browser is showing the message as mentioned before (“site could not be reached - response took to long” [ERR_CONNECTION_TIMED_OUT]). But if I - almost at the same time - use my mobile browser (Safari) and 4G connection, it shows me the webpage and I can easily access it.

So my assumption is, that it has something to do with the local network and the FB in my wifes office.

Yes, that sound reasonable. Afaik, FB 6590 is a cable router which might not be reachable from the internet by default because DSL light is very often be used. But if you say you’ve assigned a static IPv4 address you worked around that trap already. What about IPv6, could this cause problems if you haven’t opened an inbound port to reach your server?

Hi @j-ed,

IPv6 was actually still disabled at my FB 6590, since I did not activate it when I received this new one. I have now and the nextcloudpi has also portforwarding for its IPv6 address activated . Will monitor it and let you know.

Thanks for now

Hi @j-ed and all others,

Unfortunately this seemed not to be the root cause of the issue. Today I have the same trouble again, accessing the domain from outside home (aka office of my wife).

What I realized in the meantime:
a) I can ping the site (huberconsulting.ddns.net) via CMD
b) I can SSH into the server via the domain name from outside home
c) If i try Internet Explorer (not Edge or Chrome) it says something about “not safe to connect” and something around outdated TLS

Does that help?

I restarted Apache via SSH and then it worked again. Seems pretty strange. Any ideas?

Yes. Do not use Internet Explorer. Your Lets Encrypt Certificate is fine. Works for me with Mozilla Firefox.

I think the office of your wife needs a security consultant and not you.
Perhaps Internet Explorer does not support newer TLS versions.

1 Like

Thanks for the feedback. Actually the security thing is why I am on here. A security consultant won’t work, as I am the administrator and we have no money in this new business to spent it for a consultant.

However, I assume the browser is not the issue. I get several messages in the different browsers, but all cannot access the page from time to time. See pictures below. But via SSH and ping command it still works.

Please check if you have new IP address frequently, in Fritzbox you can see it.
It could be that IP was changed, but DNS cache still pointing to the old one and this cause an error.

Check if nslookup under windows pointing to the correct IP when you have an error.

Option 2 could be that Your address is blocked by your corporate policy, but if you use HPKP or/and HSTS then browser will not be able to show you any warning Landing Page.

You can check the certificate at https://www.ssllabs.com/ssltest
If it is “green” the problem is the Internet Explorer.

Dear @gas85,

thanks for the remarks. I have a static IPv4 address at the location where the nextcloud is located. So this does not change. And the strange thing, as said, is, that I can at the same time (e.g. via screen share) access the website from my laptop (location somewhere else) but from within the office, laptops are not able to connect.

I have now also used nslookup and ping commands. The laptop in my wifes office, who cannot access the domain still gets positive results for nslookup and ping. So the page itself is there but safari, chrome or whatever doe not show them.

Any further ideas?

Dear @devnull,

if I check my page there, all is green. A+ as a rating. So all seems fine. It must be located somewhere with the local settings at my wifes router.

But IE seems not to be the problem, as also Chrome or Safari show those errors.

Or your wifes pc or wifes internet explorer.

  • other pcs in the network works?
  • other browser on your wifes pc works?

Thanks @devnull

No, if a laptop is in this network, it has the same problem. Also mine, which works at home or at another location, does not work if I am at her office.

No, it is the same situation with different browsers (chrome, IE, firefox etc.)
And also the same on my laptop or another employees laptop with various browsers.

Any one any further thoughts?

Ok i read your thread again.
Is the server and client with the problem on the same network?

If yes search NAT Loopback and/or Hairpinning

If no please post from your devices.

nslookup huberconsulting.ddns.net

tracert huberconsulting.ddns.net

ping huberconsulting.ddns.net

Where does it differ from the actual correct value:

host huberconsulting.ddns.net
huberconsulting.ddns.net has address 77.23.173.8

 host 77.23.173.8
8.173.23.77.in-addr.arpa domain name pointer ip4d17ad08.dynamic.kabel-deutschland.de.

Seems all nice. But i think i would deactivate IPv6 on the fritz.box (see at the beginning of the screenhost). Perhaps only with IPv4 (if you do not need IPv6) you can solve your problem. Edit your configuration on your Fritzbox.

Perhaps only with IPv4

You mean directly in the hosts FB, so the location where the Raspi is connect to FB via LAN? Or in the office where the problems occur? Or on both?