LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-01-2009, 03:28 AM   #1
Lordlava
LQ Newbie
 
Registered: Dec 2008
Location: Perth, Western Australia
Posts: 16

Rep: Reputation: 0
Access of an application on a Linux box (the "server") from outside the Local Area Ne


I have an application that runs on Red Hat 9 Linux (I know it is old). From another (Windows) PC on the LAN I can run a client program that can access the application, by specifying the LAN IP address and port. The application uses 192.168.1.103 and port 5555. I can also access the server using the same IP address and port 21 through Cute FTP. By changing the IP address I can also access the application on another server (overseas).

However, I am unable to work out how to access the local server application from an external PC.

I tried to use the IP address from the internet with port 5555 and it failed to connect.

I use a wired and wireless ADSL2 router from TP-Link.

I tried to go into the Advanced Setup and under the NAT-Virtual Servers setup "direct incoming traffic from WAN (identified by protocol and external port) to internal server with private IP address on LAN side".

I did not know how to decide what protocol to use so I left it at the default TCP protocol. This also failed to connect.

On the Linux box I allowed the ports 20:22 using iptables to get the Cute FTP working from any PC on my LAN. I tried to do the same for the router IP address 192.168.1.1 and port 5555 but this also failed to make any difference.

I do not know whether I need to change stuff in Linus or the router or both.

I would appreciate any suggestions on what else I could try to get the client to access the server.
 
Old 08-01-2009, 04:07 AM   #2
EmrldDrgn
Member
 
Registered: Oct 2008
Posts: 40

Rep: Reputation: 16
Do you have the port forwarded on your router to the server machine's IP? If not, check out www.portforward.com . May not help, but it might, too.
 
Old 08-01-2009, 04:12 AM   #3
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Wheezy (Fluxbox WM)
Posts: 1,363
Blog Entries: 52

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
When you are accessing from an external PC, you will be connecting to the router, rather than directly to the server. So you will need to know the outward facing address of the router (eg go to dnswatch to find your public facing IP).

The other thing you will need to do is forward the particular port that you want from the router through to the server machine on the intranet. This will be in the router settings. It is more secure to just forward just the ports you need rather than directing all traffic to it (unless you are going to take extra care with the server).

You will be directing port 5555 on the router to port 5555 on 192.168.1.103. It is probably TCP traffic, although this depends on the server application you are running (find out if it requires UDP).

In terms of allowing incoming data, it will not be coming from address 192.168.1.1, but from the address of the external machine (even though it is coming via the router, the packet source address will be from the public ip of the client PC; the router attempts to be transparent). So if you are filtering with iptables, you are going to have to allow at least this one external address to initiate incoming packets on port 5555.
 
Old 08-08-2009, 07:45 AM   #4
Lordlava
LQ Newbie
 
Registered: Dec 2008
Location: Perth, Western Australia
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks for the tips. I have tried all the combinations and permutations of the iptables and the router that I can think of.

iptables commands below
iptables -F INPUT
iptables -A INPUT -p tcp --dport 20:80 -s 192.168.1.1 -j ACCEPT
iptables -A INPUT -p tcp --dport 20:80 -s 192.168.1.100 -j ACCEPT
iptables -A INPUT -p tcp --dport 20:80 -s 124.182.xxx.xxx -j ACCEPT
iptables -A INPUT -s 0/0 -i eth0 -d 192.168.1.1 -p TCP -j ACCEPT
iptables -A INPUT -p tcp --dport 5555 -s 192.168.1.1 -j ACCEPT
iptables -A INPUT -p tcp --dport 5555 -s 192.168.1.107 -j ACCEPT
iptables -A INPUT -p tcp --dport 5555 -s 124.182.xxx.xxx -j ACCEPT
service iptables save

where xxx.xxx is the end of the public facing ip address for here.

I tried adding and deleteing various combos of the above lines.

On the router I redirected port 5555 to 192.168.1.103 for TCP and UDP and TCP/UDP.

Any other hints that i could try?
 
  


Reply

Tags
firewall, redhat9


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
"Run Application" dialog box NOT running applications trident Linux - Desktop 5 03-12-2008 10:55 AM
Possible to access "HTML" file with other Application? kcarun Debian 3 01-16-2007 02:12 AM
difference between "Web server local URL" and "IPv4 address"? kpachopoulos Linux - General 2 09-17-2004 01:30 PM
"connect: No buffer space available" in my local network area SpaceCowboy Linux - Networking 5 08-30-2004 02:44 AM
"No permission to access" linux box (Samba) TheOneAndOnlySM Linux - Software 3 03-21-2004 04:57 PM


All times are GMT -5. The time now is 01:28 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