vidrus
Posts: 30
Joined: Tue Apr 17, 2012 12:06 pm

Connect RPI from external IP (not local)

Thu Jul 12, 2012 12:51 pm

Is this possible and can someone explain me step by step how to work it out?
Help would be very usefull!!

(i'm using openelec, will put some files from work location to my raspberry @ home)

User avatar
RaTTuS
Posts: 10549
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Connect RPI from external IP (not local)

Thu Jul 12, 2012 12:56 pm

at the very least
you will need to open ports on your home router ...
so you are able to ssh from work to your home IP.
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Targettio
Posts: 19
Joined: Wed May 30, 2012 11:02 am

Re: Connect RPI from external IP (not local)

Thu Jul 12, 2012 1:25 pm

If you want to just connect to the terminal and control your Pi then you need to:
• Setup SSH server on the Pi
• Setup a fixed IP for your Pi
• Log into your router and open port 22 and re-direct that port to your Pi ip address (or another port if you choose to use a non-standard one)
• Create an account with a dynamic dns service (dyndns, no-ip etc)
• Setup your router so it will send your IP to the dynamic dns service
• Access your Pi via putty using the web address you picked from the dynamic dns

If you want to be able to access the shared folders and act as if the Pi was on the same network as your work pc then you need to set up a VPN server. This is a little more involved and best left to someone a bit smarter than me.

If you just want to access some of your files and upload etc (dropbox style) then you want to look at owncloud.

Details of all the above can be found with a bit of googling.

vidrus
Posts: 30
Joined: Tue Apr 17, 2012 12:06 pm

Re: Connect RPI from external IP (not local)

Thu Jul 12, 2012 2:56 pm

I need a option to not have to open ports. Is that possible?

User avatar
RaTTuS
Posts: 10549
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Connect RPI from external IP (not local)

Thu Jul 12, 2012 3:02 pm

not easily - you will have to do a 2 stage approach
upload files to the cloud
download file from the cloud
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

vidrus
Posts: 30
Joined: Tue Apr 17, 2012 12:06 pm

Re: Connect RPI from external IP (not local)

Thu Jul 12, 2012 3:12 pm

I'm new to all this. Is there somebody who can tell me how i realise this?

p.s. there is no option to connect from another location thru a standard open port (like 80)
(NOT LOCAL!)

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Connect RPI from external IP (not local)

Thu Jul 12, 2012 3:23 pm

What I've done is a little perl script which uses traceroute to check changes to my external IP (noobish , but it isn't dependant on 3rdparty webservices).
If changed , I update my own "NoIP" page - I wonder whether my Freehoster or my ISP will register the abuse first. ;)

So sharing files - you could use any webserver available.
I'm guessing you're trying it from a network you are not administering ?
Well , perhaps they block incoming HTTP requests - and how would you forward the port to your machine ?
I don't think there is a way for you then.

A little more detail would help.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

robleady
Posts: 34
Joined: Thu Jan 12, 2012 10:24 pm

Re: Connect RPI from external IP (not local)

Thu Jul 12, 2012 3:53 pm

vidrus wrote:I'm new to all this. Is there somebody who can tell me how i realise this?

p.s. there is no option to connect from another location thru a standard open port (like 80)
(NOT LOCAL!)
Hi,

It all depends on exactly how your network is configured, which you haven't told us about...
Every network will be configured differently so there's no such thing as a standard open port.

Cheers,
Rob

vidrus
Posts: 30
Joined: Tue Apr 17, 2012 12:06 pm

Re: Connect RPI from external IP (not local)

Thu Jul 12, 2012 5:08 pm

The problem is i want to connect the rpi not at 1 location but more. So i place the rpi on the network at location 1 and a week later on the network of location 2. Wherever de rpi is connected i want to change files (overwrite) from my work location. When i connect a pc with filezilla to my webspace i can up and download files. Now i want to connect to a ftp server (in background not with software) with the rpi so i can change files from my work location. Or another solution in background... whatever if xbmc keeps running.
Last edited by vidrus on Thu Jul 12, 2012 5:15 pm, edited 1 time in total.

vidrus
Posts: 30
Joined: Tue Apr 17, 2012 12:06 pm

Re: Connect RPI from external IP (not local)

Thu Jul 12, 2012 5:11 pm

i can open ports at the base location if that helps (the locations where the files are send from to rpi) But i cannot open ports at the variable locations of the rpi.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Connect RPI from external IP (not local)

Thu Jul 12, 2012 5:26 pm

I suggest httptunnel .
I don't know wheter its maintained anymore .. Worked fine on my debian5 box.
Additionally use NoIP / DynDNS or create a simple PHP script for this task.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

vidrus
Posts: 30
Joined: Tue Apr 17, 2012 12:06 pm

Re: Connect RPI from external IP (not local)

Fri Jul 13, 2012 8:48 am

Would something like duplicity work?

User avatar
RaTTuS
Posts: 10549
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Connect RPI from external IP (not local)

Fri Jul 13, 2012 8:59 am

if you can ssh out from the remote locations then you can make a tunnel out to your work location and update via that
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Connect RPI from external IP (not local)

Fri Jul 13, 2012 9:06 am

This is going nowhere if you do not open ports.
What you want is absolutely , easily possible .

The approach which would work under your conditions is a "Cloud" sync every five minutes or so.
(Duplicity ? rsync ? DropBox ? WebDAV ? IDK)
Better create your own "push" service .

Last idea :
Use UPnP to open ports on your Router - the Pi can do this automatically everytime it detects anew network.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

wes.spears
Posts: 1
Joined: Wed Aug 15, 2012 12:25 pm

Re: Connect RPI from external IP (not local)

Wed Aug 15, 2012 12:45 pm

Vidrus,

I have a similar need. Specifically, to deploy Raspberry Pi units at remote locations.

My thought was to have them "phone home" when they are turned on. In our case, we need remote control of the devices. I am thinking of something akin to LogMeIn. When the unit is on, you could connect to it. I have no problem in setting up a dedicated server, if needed, to facilitate this.

We considered Bomgar, which is a commercial product and it is not possible, or at least not yet. We also are looking at Team Viewer. We will see.

For this forum, there are a couple of interesting ideas. The HTTPTunnel might be promising and/or trying to instantiate a persistent VPN tunnel (perhaps over port 80, if that is possible) when the unit starts.

I would be interested in any progress you have made and am happy to share ours. If this explanation helps anyone with suggestions, we welcome all thoughts and thank you.

Wes

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Connect RPI from external IP (not local)

Wed Aug 15, 2012 2:57 pm

Well ,
the problem i saw with the OP was that circumventing blocks on networks you don't own couldn't be only illegitimate , but illegal too.
If you are trusted to change or already have control over the network , you have no problems. (You can ask people , you can convince people !)
There are already literally dozens of happy people running their Pi , accessible from everywhere in the world.
They use Owncloud , HTTP , SFTP and whatever else runs on Linux.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

wh1p
Posts: 29
Joined: Tue Jul 03, 2012 11:00 pm
Location: South East UK
Contact: Website

Re: Connect RPI from external IP (not local)

Wed Aug 15, 2012 3:46 pm

Basically what your looking for is a service where you are not opening a port but instead allowing the packets of a service, now there are many firewalls which will allow you to block all incoming connections on all ports then allow a service to go through the firewall, may of which i have seen let you choose the port which the traffic should be arriving on then it will use a smart filter, (lets say for this situation your receiving SSH traffic), then it will allow ssh traffic but will block all other traffic that does not look like ssh traffic and it does this using a method otherwise known as DPI (Deep Packet Inspection) Google that term.

Now i cannot offer you help on an exact solution software/hardware but what i would say is where the raspberry pi is going to be placed see if the firewall in place support DPI and other service monitoring because you may be able to add ssh as a service to the firewall if not then see if there is a possibility of a firewall being put in place which does support these features as this is probably the safest way to do it.

Optionally, you could see if there is a possibility of a VPN service being used as a VPN is only as secure as the administrator that sets it up makes it going from using a randomly generated key to using a purchased public encryption key such as that used by online banking and payment systems and a usage of RSA encryption but I'm not going into that. All this is to say either get a firewall put in place which supports service bypass or get a VPN in place for your required usage.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Connect RPI from external IP (not local)

Wed Aug 15, 2012 8:39 pm

I suppose you both should start a new thread. If i understand correctly , you DO NOT expierence the OPs fundamental problem : he is/was not allowed to change the networks he connected to , and he could not plan for each possible scenario of configs neccessary.
Really , there are enough threads open for that.

@wh1p
AFAIK the OP does not need firewalls , not even DPI ones . His problem is that firewalls (not his own !) might stand in his way.

@wes.spears
Team Viewer won't work , VPN might be doable.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
aelsas
Posts: 64
Joined: Fri Jul 06, 2012 11:23 pm
Location: Frankfurt, Germany
Contact: Website

Re: Connect RPI from external IP (not local)

Wed Aug 15, 2012 9:45 pm

Hi,

maybe this is a suitable way for you:

Install webmin and configure it to listen on port 80.
You can upload files via "Others - Upload and Download" or "Others - File Manager".
Publishing the actual IP is possible with a dynamic DNS service then.

Best regards

Alex

wh1p
Posts: 29
Joined: Tue Jul 03, 2012 11:00 pm
Location: South East UK
Contact: Website

Re: Connect RPI from external IP (not local)

Tue Aug 28, 2012 2:15 am

This sounds like a problem where either the person in question either does not own the network, have access to control it or is not allowed to be doing such things from the network(s) being used.

I use a service on windows called Hamachi this basically makes a virtual vpn and my friends can connect to my PC without any router configurations or anything it creates a direct link to my machine i would recommend researching what Hamachi is and what Linux alternatives are available.

In fact i will save you the effort, being the nice person i am and the nice people which are logmein, they have released a beta version of Hamachi for Linux and there is a version specifically for ARM so if your lucky this might work with some wimple apt-get and some light setting up. This is the link you will need to visit to find Hamachi for Linux and make sure if you do decide to use this particular method you install the ARM architecture version:

https://secure.logmein.com/labs/

I hope this helps :)

Return to “Networking and servers”