[SOLVED] sync over the home network vs. over the internet.

Ask all your questions regarding OC 7.x Please read the Support Forum Rules
Forum rules
ownCloud 7.x will be end of life soon. See maintenance and release schedule for more details.

Time to upgrade!

Before you post; make sure you are using at least PHP Version 5.3.x - Also read Support Forum - Read this before posting
bennypr0fane
Starter
Posts: 54
Joined: Sun Aug 31, 2014 10:52 pm
ownCloud version: 8.2.2
Database: MySQL
OS: Unknown

[SOLVED] sync over the home network vs. over the internet.

Postby bennypr0fane » Sun Sep 21, 2014 1:06 am

Hello,
I have four devices that I want to sync with my Owncloud server, three of them mobile: a desktop pc, a laptop, a tablet and a phone. My server is a mini pc on my home network.
Thus, when my devices are at home, there kinda is no need for the sync traffic to go over the internet.
In fact, the desktop pc is obviously always at home, right next to the Owncloud server, so it can always do all its syncing indoors.
What are the options for making it so that the mobile devices only use the internet when out and about, and sync over the home network (wlan), when at home (and the desktop does it always)?
How would you do it?
Thanks, Ben
Last edited by bennypr0fane on Mon Jan 19, 2015 3:51 am, edited 1 time in total.
Sorry, I don't know the server details of my OC instance!

tflidd
Forum Moderator
Posts: 7159
Joined: Sat Dec 07, 2013 7:27 pm
ownCloud version: 8.2.3
Webserver: Apache
Database: MySQL
OS: Linux

Re: sync over the home network vs. over the internet.

Postby tflidd » Sun Sep 21, 2014 9:41 am

If you run a local DNS resolver (often it's done by your router), I would set the hostname manually to your local ip. In some routers you can login on a shell and make this sort of modification or your can run a dns resolver on your home server. Then you don't need to change anything on your mobile devices.

bennypr0fane
Starter
Posts: 54
Joined: Sun Aug 31, 2014 10:52 pm
ownCloud version: 8.2.2
Database: MySQL
OS: Unknown

Re: sync over the home network vs. over the internet.

Postby bennypr0fane » Sun Sep 21, 2014 5:33 pm

I hope I understood you correctly (probably not :| ).
Currently I'm not using a domain but I reach the server over its static (public) IP from outside. It also is assigned a static local IP by my router. The router does not have a command line shell for this, but a GUI from my ISP (it's their router).
However, I don't understand how this eliminates the need for the mobile devices to take a different route while at home - probably because I am quite the newbie. It's the first server that I am setting up myself, so please go easy on me ;-) .
Sorry, I don't know the server details of my OC instance!

tflidd
Forum Moderator
Posts: 7159
Joined: Sat Dec 07, 2013 7:27 pm
ownCloud version: 8.2.3
Webserver: Apache
Database: MySQL
OS: Linux

Re: sync over the home network vs. over the internet.

Postby tflidd » Sun Sep 21, 2014 5:57 pm

If you use a local DNS resolver at home, you can spoof the DNS. When your clients are asking for yourserverdomain.com, your local DNS resolver sends the local ip (instead of the public ip). If you are outside your home, a public dns server will return the correct public ip. ISP-routers are often blocked. For myself, I've put a second router behind it and there you can install OpenWRT which allows you to do what you want.

You can also modify the hosts-file of the client (setting manually some hostnames) but that's quite difficult on mobile devices and you'd have to change it depending if you are at home or not.

When you are outside your home, you could also first connect to a VPN you set up at home. Then you can always use the private ip.

bennypr0fane
Starter
Posts: 54
Joined: Sun Aug 31, 2014 10:52 pm
ownCloud version: 8.2.2
Database: MySQL
OS: Unknown

Re: sync over the home network vs. over the internet.

Postby bennypr0fane » Sun Sep 21, 2014 11:33 pm

EDIT: This here below is the solution, implemented through DNS resolver on a new Openwrt router that I put between all my devices and the gateway. Is works as long as all the devices go through the Openwrt router at home instead of connecting directly to the gateway modem.

tflidd wrote:If you use a local DNS resolver at home, you can spoof the DNS. When your clients are asking for yourserverdomain.com, your local DNS resolver sends the local ip (instead of the public ip). If you are outside your home, a public dns server will return the correct public ip.


But that can only work if I do use a domain name instead of the IP, right?
Last edited by bennypr0fane on Mon Jan 19, 2015 3:55 am, edited 1 time in total.
Sorry, I don't know the server details of my OC instance!

tflidd
Forum Moderator
Posts: 7159
Joined: Sat Dec 07, 2013 7:27 pm
ownCloud version: 8.2.3
Webserver: Apache
Database: MySQL
OS: Linux

Re: sync over the home network vs. over the internet.

Postby tflidd » Mon Sep 22, 2014 9:01 am

yes

bennypr0fane
Starter
Posts: 54
Joined: Sun Aug 31, 2014 10:52 pm
ownCloud version: 8.2.2
Database: MySQL
OS: Unknown

Re: sync over the home network vs. over the internet.

Postby bennypr0fane » Mon Sep 22, 2014 1:16 pm

I explained above that I was not using a domain name, so a solution with IP address only would be preferable, but for now I managed to make the DNS resolution work.
What I would like to ask though is for recommendations for any host resolver software that you find working well and that one might find on the Ubuntu 14.04 repos.
I can't install it on the router, but you mentioned it's also an option to make it run on the server? How does it work?
Sorry, I don't know the server details of my OC instance!

tflidd
Forum Moderator
Posts: 7159
Joined: Sat Dec 07, 2013 7:27 pm
ownCloud version: 8.2.3
Webserver: Apache
Database: MySQL
OS: Linux

Re: sync over the home network vs. over the internet.

Postby tflidd » Mon Sep 22, 2014 2:44 pm

and you said "currently" ;-) You can use a dyndns-service like no-ip.com in order to get your own subdomain.
There are several clients, for your home-net dnsmasq might be interesting.

bennypr0fane
Starter
Posts: 54
Joined: Sun Aug 31, 2014 10:52 pm
ownCloud version: 8.2.2
Database: MySQL
OS: Unknown

Re: sync over the home network vs. over the internet.

Postby bennypr0fane » Mon Sep 22, 2014 8:36 pm

Dnsmasq, got it. Thanks! Would you have a hint what to look out for when setting this up on the server instead of the router?
Like, what is the name of the feature I need to use or which topic to read most carefully in the manual.
I actually can't imagine how this works if a device sends a DNS request to the router - how is it supposed to know what to do if the DNS resolver is actually on my OC box?
Sorry, I don't know the server details of my OC instance!

tflidd
Forum Moderator
Posts: 7159
Joined: Sat Dec 07, 2013 7:27 pm
ownCloud version: 8.2.3
Webserver: Apache
Database: MySQL
OS: Linux

Re: sync over the home network vs. over the internet.

Postby tflidd » Mon Sep 22, 2014 9:00 pm

You need to turn off the dhcp-client of your rapsberry and set a static ip. Your nameserver-configurations in /etc/resolv.conf should be

Code: Select all

nameserver 127.0.0.1
nameserver dns-server-ip-from-your-provider
nameserver 8.8.8.8 #google


The parameter you need to manipulate the domain-entry is:

Code: Select all

# Add domains which you want to force to an IP address here.
# The example below send any host in doubleclick.net to a local
# webserver.
#address=/doubleclick.net/127.0.0.1
address=/your.owncloud.domain/local-ip

(you can use this also to block commercials, e.g. from doubleclick. A dns-based add-blocker:D)

The DHCP-section can be deactivated completely (by default). Normally, your router runs a dhcp server (distribution the ip-settings for the client), you can leave it doing this. Although, you have to tell him to use the raspberry-ip as dns-server. Do this at the very end, when you are sure everything is working.


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Community Edition 7.x”

Who is online

Users browsing this forum: No registered users and 1 guest