LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 09-17-2012, 05:49 AM   #1
\/4A
Member
 
Registered: Aug 2012
Posts: 112

Rep: Reputation: Disabled
Accessing Server on remote LAN


Hello,

I need to manage a remote server that I'm setting up.
It's based on Ubuntu Server 12.04 (from the minimal edition) and I need to access it over SSH, Webmin (and some server monitor/hardware failure alerting system).

Issue here is, it's going to be placed on a local LAN and obviously have an IP like 192.168.x.xxx and will be behind a hardware firewall (pretty simple - just something like a Dlink router).
I am not on the same LAN and am in a totally different location, so would obviously be accessing it over the internet.

Accessing the servers local IP number from my location will obviously not get me into it. How else can I have access to manage it?
 
Old 09-17-2012, 06:03 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
just set up port forwarding on whatever border device you have, firewall, adsl router etc. For small devices, portforward.com is really useful.
 
1 members found this post helpful.
Old 09-17-2012, 07:22 AM   #3
\/4A
Member
 
Registered: Aug 2012
Posts: 112

Original Poster
Rep: Reputation: Disabled
Thanks Chris.

When you're referring to "border device", would it be the 1st device that is connecting the whole network to the internet or (maybe) the router that the server (I wish to access) is connected to?
I've attached a diagram and what I wish to access is the EMR Server.

Knowing how ISP's in our area are, they usually configure their router with the public IP address, so all that users know is 192.168.x.xxx and they give no access to their routers.
Attached Images
File Type: png Nizar_proposed_setup.png (163.2 KB, 19 views)
 
Old 09-17-2012, 07:25 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
whatever it is that is reachable on the internet in the first instance. idealy a site to site VPN would be preferable, but for just ssh that works.
 
Old 09-17-2012, 11:02 AM   #5
\/4A
Member
 
Registered: Aug 2012
Posts: 112

Original Poster
Rep: Reputation: Disabled
Thanks for this.
I am still a bit confused - I've setup port forwarding and opened port 22 for 192.160.0.107 (which is the ubuntu server), but how would I, from over the internet connect into this?
 
Old 09-17-2012, 04:29 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
you'd hit port 22 on the public IP.
 
1 members found this post helpful.
Old 09-17-2012, 08:14 PM   #7
suicidaleggroll
Senior Member
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 2,657

Rep: Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951
ssh to the public IP. The router will see you coming in on port 22, it will check its port forwarding rules, and will forward the connection to whatever local IP you told it to send port 22 to.
 
1 members found this post helpful.
Old 09-18-2012, 02:54 AM   #8
\/4A
Member
 
Registered: Aug 2012
Posts: 112

Original Poster
Rep: Reputation: Disabled
AAHHH! I see.
However, there's still a hindrance here - the ISP provides one public IP and there's hundreds of their (different) customers connected to that. Also, the public IP keeps changing.
I tried logging in from cygwin with
Code:
ssh user@publicip
and I get
Code:
ssh: connect to host publicip port 22: Connection timed out
I go the "current" publicip from whatismyip.com
Over the local LAN I can ssh into the server with cygwin
 
Old 09-18-2012, 02:56 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
hundreds of different customers?? You've not added any port forwarding at all to that device, have you?
 
Old 09-18-2012, 03:23 AM   #10
\/4A
Member
 
Registered: Aug 2012
Posts: 112

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
hundreds of different customers?? You've not added any port forwarding at all to that device, have you?
You're scaring me!!
I've already added port 22 for the server - what should I do, immediately remove this?
 
Old 09-18-2012, 03:25 AM   #11
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
I mean, you sound like you're not actually configuring this ISP device, that that's their device, not yours. If you can't access the internet connected device (or find someone who can) then you can't allow traffic inbound through it to a specific internal node. The other option is a solution that reaches out from the server via a broker service. If you have a third server that both machines can ssh to then you can have a reverse tunnel going back to the 1st server to get in that way.
 
Old 09-18-2012, 03:36 AM   #12
\/4A
Member
 
Registered: Aug 2012
Posts: 112

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
I mean, you sound like you're not actually configuring this ISP device, that that's their device, not yours.
this is true.

Quote:
Originally Posted by acid_kewpie View Post
If you can't access the internet connected device (or find someone who can) then you can't allow traffic inbound through it to a specific internal node.
This is what I feared.

Quote:
Originally Posted by acid_kewpie View Post
The other option is a solution that reaches out from the server via a broker service. If you have a third server that both machines can ssh to then you can have a reverse tunnel going back to the 1st server to get in that way.
Would really appreciate if you could highlight on this pls.

But in the meantime I'm removing the port forwarding I setup earlier.
 
Old 09-18-2012, 03:40 AM   #13
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
This looks useful for what I described - http://wiki.fabelier.org/index.php?t..._SSH_Tunneling

This is describing an intermediary sytem, but note that this could potentially be your own home system, collapsing the roles of the "middle" and "outside" pcs. And here you may need to port forward into YOUR internal system, or rather the address your laptop usually has as and when it is connected to your home wifi etc.
 
1 members found this post helpful.
Old 09-18-2012, 03:47 AM   #14
\/4A
Member
 
Registered: Aug 2012
Posts: 112

Original Poster
Rep: Reputation: Disabled
Thanks for this, Chris.

I'm giving it a go and will post the outcome/issues.
 
Old 09-18-2012, 08:59 AM   #15
suicidaleggroll
Senior Member
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 2,657

Rep: Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951
Quote:
Originally Posted by \/4A View Post
Knowing how ISP's in our area are, they usually configure their router with the public IP address, so all that users know is 192.168.x.xxx and they give no access to their routers.
This would be a problem...but it all depends on how they set things up. I have experience with several ISPs, and they usually fall into one of two categories:

1) ISP provides a dumb modem which simply translates the incoming connection to an ethernet connection. It provides no routing whatsoever, doesn't even have its own IP. The public IP is given to the device attached to the modem, usually your own router.

2) ISP provides a modem/router combination device, which steals the external IP and only provides LAN IPs to the connected devices, but they give you the login information for the modem/router allowing you to set up things like NAT, port forwarding, firewall rules, subnet, DHCP range, etc.

I prefer #1, but in either case you can do what you're asking, the difference is going to be which device you log into to make the port forwarding rule. From the sound of it, your ISP has given you the device in #2 (modem/router hybrid), but no login information for it. This would be unacceptable to me, and I would be calling to complain immediately. No customizable subnet, or DHCP range...inexcusable in my opinion. Depending on the type of connection, you may be able to purchase your own dumb modem, give them the MAC address, and set that up in place of the modem/router hybrid they provide (pushing you into category #1 above). Either way, first thing I would do is get on the phone with the ISP.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] accessing server from remote host ridoy Programming 1 03-02-2011 07:35 AM
SLOW Accessing Home Web Server on LAN cyngallery Linux - General 9 08-19-2006 09:15 PM
accessing a host from a remote server onlynimal Linux - Networking 5 04-20-2006 07:37 AM
Accessing a remote X server from a Windows machine escordeiro Linux - Software 1 03-23-2005 09:24 PM
accessing mail server from remote tushar_mahakul Linux - Networking 1 09-14-2004 04:40 AM


All times are GMT -5. The time now is 11:52 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration