Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Dynamical DNS: 2 IPs, 4 machines, 1 Masterzzzzz!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
kha0s
n00b
n00b


Joined: 11 Feb 2007
Posts: 21
Location: Lisbon, PT

PostPosted: Wed Sep 19, 2007 3:30 pm    Post subject: Dynamical DNS: 2 IPs, 4 machines, 1 Masterzzzzz! Reply with quote

Here's the deal folks:
I've got two places, separated by a big Ocean, with ADSL connections. Let's call them "Home" and "Jail". I've got 2 computers at Home and 2 computer at Jail. On each computer, (all Gentoo powered naturally) there are at least 2 users (root and joe).

Objective: control them all by "ssh" from anywhere in the earth (and even from the Moon if they ever get broadband up there)

1: Getting a static IP for Home and Jail:
I've intersected from several sources that DynDNS.com is the place to go. I've checked it out and it seems they offer 5 free hostnames per registration:
Question1: Does that mean per registration I get: one static ip for Home, one static ip for Jail, and end up with 3 spare ones?

2: Getting past my NAT-FIREWALL router
On Home, I've got a DG834N and on Jail I've got a DG834PN. The first one even has embedded support for DynDNS.com! The point is they're both have a NAT firewall. Now here comes the BIG issue:
In both routers, I can add a "Inbound Service" firewall rule that takes the following arguments:
Code:

Service:               SSH(TCP/UDP:22)
Action:                ALLOW always
Send to LAN Server:    192.168.0.2
WAN Users:             ANY
Log:                   Always


Now let's say computer1=192.168.0.2 and computer2=192.168.0.3.
Question2: How the heck I'm I going do ssh into computer2, since in my router I can only configure ONE "LAN Server"?

I'm kind of newbie with ssh, so, if there's some kind of outrageously simple solution for this, please don't hack me! 8)

Thanks in advance!
_________________
Who will guard the guards?
Back to top
View user's profile Send private message
cipherus
Apprentice
Apprentice


Joined: 07 May 2004
Posts: 174

PostPosted: Wed Sep 19, 2007 4:48 pm    Post subject: Reply with quote

With a service like DynDNS, they do not give you a static IP address. You sign up for a domain named (for example jail.dyndns.com) and when your IP address changes, it will update with their service automatically. Well not exactly automatically, some routers contain a service that will update to dyndns whenever you IP address changes. If your router does not have this, then you will need to run a service from one of your computers which does this. The only way to really figure it out is to just sign up and start testing, it is afterall a completely free service.

Secondly, with your router and port forwarding, you can only have port 22 (the ssh port) forwarded to one computer on your LAN. The trick is, you can forward a different port (maybe port 27) to a different computer. Some routers let you define which external port gets mapped to which internal port, for example, making jail.dyndns.com port 27 forward to internal LAN ip address 192.168.0.105 port 22. However, if your router doesn't have this functionality, then you will have to change your sshd to listen on port 27 instead of 22. For further reading on how to change your sshd listening port do this command:
Code:
man sshd_config


Another alternative would be to forward port 22 to one of your computers. Once you log into that computer with ssh, you can then ssh from there to your second computer. Neat, eh?

p.s. i already hacked you.
Back to top
View user's profile Send private message
kha0s
n00b
n00b


Joined: 11 Feb 2007
Posts: 21
Location: Lisbon, PT

PostPosted: Wed Sep 19, 2007 9:43 pm    Post subject: Reply with quote

I see... Fortunately I'm not expecting to handle more than 65535 machines under the same sub-net, :). What I haven't figured out yet is if DynDNS.com allows you to created 5 different domain names for 5 different IP addresses, i.e, if with only one registration, keeping the example above, I would be able to have a domain name for House's IP and a domain name for Jail's IP. I would very much like to exclude the possibility that what they're really saying is that you get 5 different names for the SAME IP, with each registration....

PS: Yes, I noticed! The question is, was the door opened or was the door LEFT opened....
_________________
Who will guard the guards?
Back to top
View user's profile Send private message
cipherus
Apprentice
Apprentice


Joined: 07 May 2004
Posts: 174

PostPosted: Thu Sep 20, 2007 5:34 am    Post subject: Reply with quote

it was right opened. and for the record, there is no spoon.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum