Android app can not connect with the nextcloud server in the wlan

Hello.
I have installed the nextcloud app (v1.2.0) on my nexus 5.
I can not connect with my wlan in my nextcloud server. Why? WhatĹ› wrong?

Curiously with the mobilfunkconnection i can login in my nextcloud server.

Curiously the connection with the android webbrowser google always successfull with wlan and mobilfunkconnection.

Thanks

My assumption is that it has something to do with IPv6. I also had such a problem and could fix it by running

ip -6 addr add <IPv6 address>/64 dev eth0
ip -6 route add default via fe80::1 dev eth0

(replace <IPv6 address> by your actual public IPv6 address).

It should be noted that this only was necessary because I had to do this because I had set up a false AAAA DNS record. The server I use is a VPS from Netcup. Maybe this is helpful for you, too.

As a general advice, this is a bit risky because it only applies for one specific situation in a specific environment (hoster, local network) and can break your ipv6 connectivity (or enable ipv6 with a broken connection).

What is strange that it works on the mobile webbrowser. Not sure if the android client supports ipv6 or not??

ip -6 addr add /64 dev eth0
ip -6 route add default via fe80::1 dev eth0

thanks benediktg,
please can you tell me, must i execute these commands in the terminal at server or
I have to make an entry in a system folder (like /etc…)
Thanks.

Not sure if the android client supports ipv6 or not??

This is a good question.

Have you try ping or traceroute using wlan and mobilfunkconnection to your nextcloud server IP?

I take by the fact you say you are trying to access Nextcloud via your WLAN that you are running your Nextcloud server at home? That being the case unless your router supports NAT Loopback your attempt to connect to NC will be getting directed to your primary router and hence will not work.

If my assumptions are correct you’ll need to set up an internal dns server to route internal requests to your domain to an internal ip address; for that I’d recommend dnsmasq as it’s relatively simple to set up.

Yes my nextcloud server running at home.
And with my wlan home i cannot connect to my server [quote=“dcrdev, post:7, topic:2626”]
hat being the case unless your router supports NAT Loopback your attempt to connect to NC will be getting directed to your primary router and hence will not work
[/quote]

Thats possible

Now I went to my friend and Login in his WLan. The Connection to my nextcloud also fails in his wlan.

Can you attempt to access it via a browser and post what response code (if any) you get back? Also have you tried pinging the domain ?

i can access via browser to the nextcloud server wlan and mobilfunk-connection (no responce code)

pinging the public ipdress (188.xxx.xxx.xxx) with android to the nextcloud server ist ok with wlan and mobilfunk-connection.

This is the message when i want to see a picture from my nextcloud server with wlan

So it is a public server. Do you use ipv6 at all?

I don’t use android but do you use any firewall on it? Perhaps you must allow the owncloud app to use your wifi connection? The desktop client/webdav is working via your home network?

Have you try using IP Address (server IP address) rather than hostname -like Manu440hz said?

With the public ip address (htttps://188.xxx.xxx.xxx) the server is found, but the certifate must be confirm. but than the message come: An unknown error is occured,

With the local ip adress (https://192.168.xxx.xxx) the server is found and i can login.

Can you check your ssl settings: ssllabs.com
perhaps the client refuses a connection if it isn’t considered to be secure.

This is the result

Well I imagine the reason it’s not working via the app and connecting to the ip address is that the certificate is not issued to your ip, but your domain instead.

It’s good that you can reach your server via the ip though, it suggests the issue with the domain is dns related. It’s very difficult to say what the problem is without seeing your web server configuration, ssl configuration and how you’ve got dns set up.

Here is my config.php

<?php
$CONFIG = array (
  'instanceid' => 'och4tc5gma78',
  'passwordsalt' => 'XXXXXXXXwcccccccccccccXXXXXXXXX',
  'secret' => 'xxxxx+8hX0GRLSHGrl34/xxxxxxxxxm9t7R6/xxxxxx',
  'trusted_domains' => 
  array (
    0 => '192.168.178.25',
    1 => 'xxxxxxxxxx.dynv6.net',
  ),
  'datadirectory' => '/srv/nextcloud',
  'overwrite.cli.url' => 'https://192.168.178.25/nextcloud',
  'dbtype' => 'mysql',
  'version' => '9.1.0.16',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '9OsH.4nP-.,',
  'logtimezone' => 'UTC',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 0,
  'memcache.local' => '\\OC\\Memcache\\APCu',
);

And error is the while saerch server

a) I’m not sure overwrite.cli.url is what you think it is.
b) Why are you try to access the root domain in the above screenshot? You’re serving nextcloud from subdomain.domain.net/nextcloud.
c) I’m assuming you forgot to remove your domain from the above config - needless to say I have tried accessing that address and I can access it.

If your dns entry also resolves an ipv6 address, you should tell your server to answer ipv6 requests as well. On your home network, you have dual stack meaning that ipv6 is preferred. On the mobile network you only have ipv4. 2 possible solutions:

  • tell your server to handle ipv6: check with netstat -tlpuen if apache already listens to ipv6 (https://httpd.apache.org/docs/2.4/en/bind.html) and the address from the ssllabs-test really is the ipv6-address of your server (see ifconfig).
  • only use a dns name that resolves ipv4 only (you need to use a dynamic dns provider, such as no-ip.com (there are others as well)).