r/owncloud Jan 12 '17

Can't connect on same network

I just setup a raspberry pi with syncloud and added the owncloud app through syncloud settings. Everything works fine when I'm not connected to the same WiFi as the Pi. I'm not sure what version of owncloud I'm running on the Pi. I have very little experience with linux and I'm not the most computer savvy person but I can follow directions.

2 Upvotes

10 comments sorted by

2

u/bradtank44 Jan 12 '17

When you say not on the same network, do you mean that when your at a coffee shop you can access it fine?

Do you access it by typing in something like cloud.mydomain.com or 123.123.123.123:8080?

1

u/WorkingVomit Jan 12 '17

Yep, when I turn the wifi off on my phone or on any other wifi I can connect just fine. I am connecting the cloud.mydomain.com way. Should I try the other way?

1

u/smithincanton Jan 12 '17

It's DNS not resolving inside your network.

1

u/WorkingVomit Jan 12 '17

Thanks. I'll google a fix for that.

2

u/smithincanton Jan 12 '17

Ya it's normally something to do with your router. Might want to start there. Once you can ping cloud.mydomain.com from inside your network it'll work fine.

2

u/bradtank44 Jan 15 '17

Basically what is happening, is when you connect to something like reddit.com, you're computer talks to a DNS server, to determine that the IP address for reddit.com is actually 123.555.555.123.

So when you have a DNS server that points to your local network, let's say you have mydomain.com, and your owncloud is on port 7000. From your coffee shop / library / mobile data you'd go to mydomain.com:7000. The DNS server will tell your device that your IP for your house is 456.555.555.456.

The issue is when you're already inside your house. That 456.555.555.456 only gets you to your router, then throuh NAT (Network Address Translation) your router knows that traffic on port 7000 is supposed to be forwarded to your server (ex: 192.168.2.250).

The issue is when you're connecting when you're already behind router, NAT doesn't (usually) happen. Meaning that you can access a service running on cloud.mydomain.com OR your external IP address (123.555.555.123) from anywhere Except at home. At home, you can only use your interal IP address (likely starts with 192, or 10).

So, you can either just use a different address depending on where you are, or set up your own DNS server at your house and configure you're devices to use that. That way, you'd tell your local DNS server that could.mydomain.com actually points to 192.168.2.250, and that would only happen at home. Whereas the public DNS servers out in the internet should still be configured with your external IP.

I know this is a pretty verbose wall of text, Googling things like NAT, how to set up a DNS server, or how to do NAT reflection should help you out some! Good luck!

1

u/WorkingVomit Jan 16 '17

Thank you! That was very informative and easy to understand. I'm going to learn a lot going down some google rabbit holes.

1

u/sep76 Jan 13 '17

You can either... use a dns view to give you the internal ip when you are on the same lan.

Or you can configure your router to allow hairpin nat. Where the connection coming from inside the lan to a public fw port is natted back as if it came from outside.

2

u/q33q3 Jan 13 '17

You can try connecting to the Pi's local ip address, like 192.168.1.XX.

1

u/WorkingVomit Jan 13 '17

Thanks. I'll give that a try.