Networking Forums

Networking Forums > Computer Networking > Linux Networking > Connecting from outside to Linux Box behind router

Reply
Thread Tools Display Modes

Connecting from outside to Linux Box behind router

 
 
M
Guest
Posts: n/a

 
      10-28-2004, 12:58 PM
Hi,

Sorry I'm a newbie to networking and linux and I'm trying to figure
out a way to connect to my linux box in 2 ways:
1. SSH'ing from my XP machine which is on wireless within the network
2. Being able to access it externally from anywhere via ssh or browser

I have a cable modem, a Linksys wireless router with a linux box and
XP laptop behind it. Here is a simple diagram of my network situation.

I am completely lost most likely because i have no idea what i'm
doing. But trust me, i'm managing to confuse myself as much as
possible.

I also signed up for a DDNS service and i wanted to know how i could
get the hostname i signed up for to point to my linux box behind my
router. Currently it just seems to point to the router itself. I
assume once I solve the previous problem above I can figure out this
one.

If anyone can help me figure this out or point me to some
documentation with in some sort of step by step process I would VERY
MUCH appreciate it. I've been trying to read previous posts but
nothing seems to make sense to a newbie like me.

Thank you in advance for your time and patience,
M
 
Reply With Quote
 
 
 
 
James Knott
Guest
Posts: n/a

 
      10-28-2004, 02:48 PM
M wrote:

> Hi,
>
> Sorry I'm a newbie to networking and linux and I'm trying to figure
> out a way to connect to my linux box in 2 ways:
> 1. SSH'ing from my XP machine which is on wireless within the network
> 2. Being able to access it externally from anywhere via ssh or browser
>
> I have a cable modem, a Linksys wireless router with a linux box and
> XP laptop behind it. Here is a simple diagram of my network situation.


I have a similar setup. I have both ssh and vpn access from anywhere,
including wireless, while at home. Your firewall/router has to be
configured to pass ssh and vpn etc., to whichever computer you wish to
handle incoming connections.
>
> I am completely lost most likely because i have no idea what i'm
> doing. But trust me, i'm managing to confuse myself as much as
> possible.
>
> I also signed up for a DDNS service and i wanted to know how i could
> get the hostname i signed up for to point to my linux box behind my
> router. Currently it just seems to point to the router itself. I
> assume once I solve the previous problem above I can figure out this
> one.


First, check to see if you've got a permanent host name. In my case, the
host name is derived from the modem and firewall mac addresses, which never
change.
>
> If anyone can help me figure this out or point me to some
> documentation with in some sort of step by step process I would VERY
> MUCH appreciate it. I've been trying to read previous posts but
> nothing seems to make sense to a newbie like me.
>
> Thank you in advance for your time and patience,
> M


--

(This space intentionally left blank)
 
Reply With Quote
 
Bernhard Kastner
Guest
Posts: n/a

 
      10-28-2004, 03:24 PM
M schrieb:
> Hi,
>
> Sorry I'm a newbie to networking and linux and I'm trying to figure
> out a way to connect to my linux box in 2 ways:
> 1. SSH'ing from my XP machine which is on wireless within the network
> 2. Being able to access it externally from anywhere via ssh or browser
>
> I have a cable modem, a Linksys wireless router with a linux box and
> XP laptop behind it. Here is a simple diagram of my network situation.
>


the keyword is portforwarding

You have to start a SSH-Server on your linux-machine (/etc/init.d/ssh start), so
you can access it within your internal network (for example from your XP-Machine)

To access the PC from outside, you have to configure the router, that the
requests on the port, you started ssh with (22 by default), are forwarded to
your Linux Box on the internal IP.


--
Bernhard | theEdge
-Linux User #368478-
http://www.alf.at.tc
Austrian Linux Forum
 
Reply With Quote
 
M
Guest
Posts: n/a

 
      10-29-2004, 06:23 AM
Thank you everyone for your suggestions. I seem to be able to SSH and
access my linux box from within my network on my laptop

Now the next question I have is how can i access it from outside my
network.
I signed up for DynDns and have a static URL. With the port
forwarding, if I go to that URL it points to my linux box correctly.
But it looks like outside my network i just get a server error. Any
ideas? There is probably some important networking concept I am
missing out on so if anyone can explain I would really appreciat it.

Thank you from a seriously hard core newbie

Maytal

James Knott <(E-Mail Removed)> wrote in message news:<a8qdnc57lZtLmxzcRVn-(E-Mail Removed)>...
> M wrote:
>
> > Hi,
> >
> > Sorry I'm a newbie to networking and linux and I'm trying to figure
> > out a way to connect to my linux box in 2 ways:
> > 1. SSH'ing from my XP machine which is on wireless within the network
> > 2. Being able to access it externally from anywhere via ssh or browser
> >
> > I have a cable modem, a Linksys wireless router with a linux box and
> > XP laptop behind it. Here is a simple diagram of my network situation.

>
> I have a similar setup. I have both ssh and vpn access from anywhere,
> including wireless, while at home. Your firewall/router has to be
> configured to pass ssh and vpn etc., to whichever computer you wish to
> handle incoming connections.
> >
> > I am completely lost most likely because i have no idea what i'm
> > doing. But trust me, i'm managing to confuse myself as much as
> > possible.
> >
> > I also signed up for a DDNS service and i wanted to know how i could
> > get the hostname i signed up for to point to my linux box behind my
> > router. Currently it just seems to point to the router itself. I
> > assume once I solve the previous problem above I can figure out this
> > one.

>
> First, check to see if you've got a permanent host name. In my case, the
> host name is derived from the modem and firewall mac addresses, which never
> change.
> >
> > If anyone can help me figure this out or point me to some
> > documentation with in some sort of step by step process I would VERY
> > MUCH appreciate it. I've been trying to read previous posts but
> > nothing seems to make sense to a newbie like me.
> >
> > Thank you in advance for your time and patience,
> > M

 
Reply With Quote
 
James Knott
Guest
Posts: n/a

 
      10-29-2004, 02:13 PM
M wrote:

> Thank you everyone for your suggestions. I seem to be able to SSH and
> access my linux box from within my network on my laptop
>
> Now the next question I have is how can i access it from outside my
> network.
> I signed up for DynDns and have a static URL. With the port
> forwarding, if I go to that URL it points to my linux box correctly.
> But it looks like outside my network i just get a server error. Any
> ideas? There is probably some important networking concept I am
> missing out on so if anyone can explain I would really appreciat it.


As I mentioned in the other note, check to see if your host name is static.
If based on mac addresses, it is. This means you'll always be able to
access your computer by name, though that name may be somewhat long.
If it's based on your IP, then you're out of luck.

--

(This space intentionally left blank)
 
Reply With Quote
 
Buck Turgidson
Guest
Posts: n/a

 
      10-30-2004, 10:40 AM

"M" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hi,
>
> Sorry I'm a newbie to networking and linux and I'm trying to figure
> out a way to connect to my linux box in 2 ways:
> 1. SSH'ing from my XP machine which is on wireless within the network
> 2. Being able to access it externally from anywhere via ssh or browser
>
> I have a cable modem, a Linksys wireless router with a linux box and
> XP laptop behind it. Here is a simple diagram of my network situation.
>
> I am completely lost most likely because i have no idea what i'm
> doing. But trust me, i'm managing to confuse myself as much as
> possible.
>
> I also signed up for a DDNS service and i wanted to know how i could
> get the hostname i signed up for to point to my linux box behind my
> router. Currently it just seems to point to the router itself. I
> assume once I solve the previous problem above I can figure out this
> one.
>
> If anyone can help me figure this out or point me to some
> documentation with in some sort of step by step process I would VERY
> MUCH appreciate it. I've been trying to read previous posts but
> nothing seems to make sense to a newbie like me.
>
> Thank you in advance for your time and patience,
> M



I have a cable modem and a wired router. I access my Linux box over the
Internet using ssh. You need to open port 22 on you router, and forward it
to your Internal IP (192.xx.xx.xx) of the linux box. You do that with your
router admin page. That's key to all of this, whether you use a DDNS
hostname, or just the IP address.

I don't have a static IP, although it changes very infrequently (every few
months). So I just ssh to the IP address.

You should also read-up on "hardening" your box, such as shutting down any
unneeded services that could be an security risk. I bought a book a linux
security, which taught me alot.

In case the IP changes, I have a cron job that, every hour, mails the
current IP to a yahoo mail account (which gets filtered to "Trash"). So if
the IP changes, I'll know it remotely. Use www.whatismyip.com as shown
below. The perl script just greps for an IP mask.

wget -q -O - www.whatismyip.com | /usr/local/bin/ip.pl | mail -s "Linux
Maint Message: IP Address" (E-Mail Removed)



----- ip.pl
#!/usr/bin/perl -w

use strict;

my $ip_mask = "(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})";

while (<>) {
while ( $_ =~ /($ip_mask)/ig ) {
print " $1\n";
}
}


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
linux router connecting to dd-wrt(s) for VPN Damon Getsman Wireless Internet 8 04-26-2008 12:17 PM
linux router connecting to dd-wrt(s) for VPN Damon Getsman Linux Networking 8 04-26-2008 12:17 PM
Connecting to Exchange with Linux Ian Cowley Linux Networking 1 09-30-2004 09:24 AM
connecting to linux with lan Slavko Vorkapitch Windows Networking 2 09-21-2004 04:01 AM
Connecting Wireless Router to a Linux-IP-Masquerading based network Sergei Fedorov Linux Networking 0 07-06-2003 08:05 PM



1 2 3 4 5 6 7 8 9 10 11