LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-09-2013, 04:53 PM   #1
tekra
Member
 
Registered: Aug 2010
Location: Brisbane, Australia
Distribution: Gentoo, Slackware, PCLOS, Debian
Posts: 230
Blog Entries: 2

Rep: Reputation: 50
Peer-to-peer comms with a friend via the Internet.


As a long-time Lx user I have a friend who relies on my assistance for his own home Lx box. I'd like to be able to login to his machine across the 'Net from time to time for routine maintenance and repair, and am unsure of how to go about this.

My googling has resulted in a number of 'HowTo' pages that mostly refer to IP tunnelling as the solution, but these all seem to address the 'workstation behind a server' scenario - i.e. the typical corporate setup. We both have standard broadband accounts with a modem/router as the gateway to the 'Net.

Two issues are immediately obvious:

1. How to determine our IP addresses. I know that this can be done via such sites as the following, but I'm unsure as to whether the address given is permanent:

http://whatismyipaddress.com/

2. How to 'get past the router'. I'd guess that the tunnelling info may answer part of this, but would like some more specific info.

Once these two have been solved, a standard SSH login should be easy, and could presumably be expanded to VNC and/or VoIP.

If those more knowledgeable about these matters are kind enough to respond, I'd be happy to summarize the info collected, add the results of my efforts, and post the lot on my LxQ blog to serve as a future reference.

With thanks to all who may reply.
 
Old 06-09-2013, 11:34 PM   #2
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
do you have public IP-addresses? perhaps dynamic DNS is your best choice for determining IP-addresses of each other
 
Old 06-10-2013, 11:08 AM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
You can use a dynamic DNS setup, or if you have a 3rd party web/ftp host you can periodically run a script to grab the public IP and push it to the ftp, so you always know what the current public IP is. Or you can just have him go to whatismyip.com every time you need to connect to see what the public IP is.

Unless he's purchased a static IP through his ISP, chances are it's going to change periodically. How often depends on the ISP...I technically have a dynamic IP, but it hasn't changed in over two years.

Then you'll need to set up port forwarding in the router to push incoming connections on port 22 (or a custom port of your choosing) to the local IP of his machine. The machine should have a static IP on the local network so you don't need to worry about changing the port forwarding IP in the router every time his box comes up with a different IP.


So the overall chain goes:
Give his linux box a static IP on the local network
Set up his router to forward incoming connections on port 22 (or a custom port of your choice) to the linux box
Find out his public IP via whatever means you like
Connect to the public IP at the specified port
 
Old 06-11-2013, 04:19 PM   #4
tekra
Member
 
Registered: Aug 2010
Location: Brisbane, Australia
Distribution: Gentoo, Slackware, PCLOS, Debian
Posts: 230

Original Poster
Blog Entries: 2

Rep: Reputation: 50
Thanks for the info, guys. First up, we both use a large local ISP (Optus) here in Australia, mine via 3G wireless broadband, his via copper ADSL. I'd figured that something like this was the case:

> Unless he's purchased a static IP through his ISP, chances are it's going to change periodically. How often depends on the ISP...I technically have a dynamic IP, but it hasn't changed in over two years.

> Then you'll need to set up port forwarding in the router ...

Haven't done this, so will investigate.

> The machine should have a static IP on the local network ...

Yep, have this covered.

> You can use a dynamic DNS setup ...

This is an option in the router, so I'll take a closer look.

> you can periodically run a script to grab the public IP ...

I'm fluent enough in Perl to cover this.

> So the overall chain goes:
> Give his linux box a static IP on the local network
> Set up his router to forward incoming connections on port 22 (or a custom port of your choice) to the linux box
> Find out his public IP via whatever means you like
> Connect to the public IP at the specified port

Good summary! But it's the last one that's still uncertain. What does a "through the router" IP address look like on the commandline? Perhaps:

># ssh fred@49.35.129.11-192.168.1.101

... where the first IP is the router on the Inet, and the second is the LxBox on the LAN?
 
Old 06-11-2013, 04:35 PM   #5
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
actually what you want can easily be done with a free logmein account and a copy of hamachi, bascially it allows you to create a virtual private lan and then with the client, join both machines to that lan and then they can talk to each other as if they are on an actual lan.

the linux client can be downloaded here:
https://secure.logmein.com/labs/
 
Old 06-11-2013, 04:52 PM   #6
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 912

Rep: Reputation: 174Reputation: 174
Quote:
Originally Posted by tekra View Post
> You can use a dynamic DNS setup ...

This is an option in the router, so I'll take a closer look.
The Dynamic DNS option in your friend's router is most likely just an updater for a dynamic DNS provider. It doesn't provide a dynamic DNS service, it just updates one. You'd need to set up the dynamic DNS provider account and hostname first with someone like dyn.com or no-ip.com.

As an alternative to using the router's updater, you can use something like ddclient on your friend's system to keep the dynamic DNS hostname updated with the current IP. There are some good reasons for doing that. Some dynamic DNS providers of free DDNS will delete your account if you don't update it periodically. The router's dynamic DNS updater probably only updates the DDNS name when the IP address changes, which may not be often enough to keep the DDNS account from being deleted. This is generally not a problem if you have a paid DDNS account.

Quote:
Originally Posted by tekra View Post
What does a "through the router" IP address look like on the commandline? Perhaps:

># ssh fred@49.35.129.11-192.168.1.101

... where the first IP is the router on the Inet, and the second is the LxBox on the LAN?
You would just ssh to the public IP, "ssh fred@49.35.129.11" or to the dynamic dns hostname "ssh fred@fredsbox.homelinux.net". The homelinux.net domain name is one that you can define a hostname on (in this example, fredsbox) at dyn.com. The dynamic DNS providers generally have a number of domain names you can pick from when you define your hostname@domainname.

Getting to the proper internal IP behind your friend's firewall is a function of the port forwarding on the router. You will set up his router to forward port 22 to his internal static IP.

Last edited by Z038; 06-11-2013 at 04:59 PM.
 
Old 06-12-2013, 08:32 AM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by tekra View Post
Good summary! But it's the last one that's still uncertain. What does a "through the router" IP address look like on the commandline? Perhaps:

># ssh fred@49.35.129.11-192.168.1.101

... where the first IP is the router on the Inet, and the second is the LxBox on the LAN?


Quote:
Originally Posted by Z038 View Post
You would just ssh to the public IP, "ssh fred@49.35.129.11" or to the dynamic dns hostname "ssh fred@fredsbox.homelinux.net". The homelinux.net domain name is one that you can define a hostname on (in this example, fredsbox) at dyn.com. The dynamic DNS providers generally have a number of domain names you can pick from when you define your hostname@domainname.

Getting to the proper internal IP behind your friend's firewall is a function of the port forwarding on the router. You will set up his router to forward port 22 to his internal static IP.
^ This

You just connect to the public IP, and the router uses the port forwarding rule you set up to push the connection to the correct IP on the LAN.
 
Old 06-12-2013, 09:41 AM   #8
tekra
Member
 
Registered: Aug 2010
Location: Brisbane, Australia
Distribution: Gentoo, Slackware, PCLOS, Debian
Posts: 230

Original Poster
Blog Entries: 2

Rep: Reputation: 50
Thanks for all the replies; I'm starting to get an overview of the situation. My question about a "through the router" IP address was prompted by this short page on IP tunnelling. It's evidently well-established, but requires two kernel modules:

http://lartc.org/howto/lartc.tunnel.ip-ip.html

This would work if the router were a server, but not for a standard "black-box" home unit, since the modules couldn't be installed. Port forwarding seems to be the answer:

> You just connect to the public IP, and the router uses the port forwarding rule you set up to push the connection to the correct IP on the LAN.

The Dynamic DNS and hamachi solutions look interesting. I'll take some time to investigate these options and post back with results.

Last edited by tekra; 06-12-2013 at 09:43 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
The Alternate Internet: a free Peer-to-Peer network? tangoking General 4 06-18-2009 09:18 PM
accessing shared Internet Connection on a MS peer to peer LAN from PC running Linux inschris Linux - Networking 2 04-09-2006 02:40 PM
peer-to-peer( lime wire ) is not letting prozilla to download at satisfactory speed b0nd Linux - General 3 10-21-2005 01:36 PM
Does any body have a simple Samba Config file for a peer to peer network? tlawlessrr Linux - Software 1 03-24-2004 11:26 PM
sharing resources on a LAN w/MS-Win98 & Linux (Peer-to-Peer) mfsjas Linux - Networking 1 12-20-2001 04:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration