LinuxQuestions.org
Visit Jeremy's Blog.
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 03-21-2011, 08:51 PM   #1
sadicolas
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Rep: Reputation: 0
Ports unreachable for online conections


Hi, i'm trying to run a server for a game, that requires a few ports open (*since i connect to the internet with a router); for example one of the ports that needs to be open is "8888". But i tryed opening it thru my router localhost and it doesn't work (d-link DIR-400), so i was thinking if there's any way to open the ports of the router directly from Ubuntu; maybe console or program?

for example for windows there's (Smart Port-fowarding) wich opens the ports you want without goint thru the router page.

Thx in advanced.
 
Old 03-21-2011, 09:24 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
You can use the port forwarding feature on the router.

Quote:
Originally Posted by ftp://ftp.dlink.com/Gateway/dir412/Manual/dir412_manual_100.zip
Port Forwarding is a feature that allows you to open a single port or a range of ports and redirect the data received through
those ports to a single PC on your network.
Name: Enter a name for the rule or select an application from the
drop-down menu. Select an application and click << to
populate the fields.
IP Address: Enter the IP address of the computer on your local network
that you want to allow the incoming service to. If your
computer is receiving an IP address automatically from the
router (DHCP), you computer will be listed in the “Computer
Name” drop-down menu. Select your computer and click
<<.
Public Port/
Private Port: Enter the range of ports that you want to open next to the
Private Port and Public Port fields. The private and public
ports are usually the same. The private ports are the ports
being used by the application on the computer within your
local network, and the public ports are the ports seen from
the Internet side.
Traffic Type:
Use the drop-down menu to select whether TCP, UDP, or All
types of traffic are being used for the port forwarding rule.
Schedule:
Select a schedule for when the Port Forwarding Rule will be
enabled. The schedule may be set to Always, which will allow
the particular service to always be enabled. You can create
your own times in the Tools > Schedules section.
ftp://ftp.dlink.com/Gateway/dir412/M...manual_100.zip

Last edited by andrewthomas; 07-15-2011 at 01:30 PM.
 
Old 03-21-2011, 11:41 PM   #3
sadicolas
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by andrewthomas View Post
You can use the port forwarding feature on the router.


ftp://ftp.dlink.com/Gateway/dir412/M...manual_100.zip
Hi Andrew, thx for answer, i've tried portfowarding; in fact in linux i go to system>network tools and it shows that the port 8888 is open, but when i PING the port from my other PC over the internet it says the port is unreachable.

im using (SubNetOnline) to ping the port.

and i know it's not open because i can't connect to the server using my windows machine, meaning the port isn't open.

*192.168.0.104 is the LAN IP of my linux machine
Attached Thumbnails
Click image for larger version

Name:	portfowarding.png
Views:	7
Size:	142.1 KB
ID:	6495   Click image for larger version

Name:	ports opened.png
Views:	4
Size:	150.9 KB
ID:	6496  
 
Old 03-21-2011, 11:51 PM   #4
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
edit

Last edited by andrewthomas; 03-22-2011 at 12:09 AM.
 
Old 03-22-2011, 04:38 AM   #5
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
Quote:
i PING the port from my other PC over the internet it says the port is unreachable.
I think a little clarification is in order as it sounds like you have a different problem. Ping does not work on ports. Ping works on ICMP messages which is port agnostic. If you can't ping the machine, you have a lower level connectivity issue that is unrelated to whether or not the port is open. If you have a router in between, make sure that the router is configured to respond to ping; many by default do not for security.

Edit: I noticed you referring to the online port scanning tool, not the ping tool.

In this case, the next thing to check is to make sure that the application is in fact listening on the desired port. You need to have both an application listening AND the port forwarded in your router or else the port will be closed. On your linux server, you can get this information in a couple of ways. The first would be to use the netstat command and grep for the desired port. For example: netstat -pane | grep 8888 and you should see the (LAN) IP address as well as the application/PID associated with your server application. This indicates that the game serve is running and that it is listening on the correct interface. Note, there may be a configuration parameter where you specify which interface to bind/listen to and you might need to ensure that this is correct, e.g. not localhost only.

One you know that this is working, you can use NMAP on your LAN IP and then again on your public IP to see if this port is open. It is effectively what the website you were using does. If you find that it is open when you scan your public IP, but the web tool does not report it being open, it indicates that something beyond your router is blocking the connection.
 
Old 03-22-2011, 09:50 AM   #6
sadicolas
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Noway2 View Post
I think a little clarification is in order as it sounds like you have a different problem. Ping does not work on ports. Ping works on ICMP messages which is port agnostic. If you can't ping the machine, you have a lower level connectivity issue that is unrelated to whether or not the port is open. If you have a router in between, make sure that the router is configured to respond to ping; many by default do not for security.

Edit: I noticed you referring to the online port scanning tool, not the ping tool.

In this case, the next thing to check is to make sure that the application is in fact listening on the desired port. You need to have both an application listening AND the port forwarded in your router or else the port will be closed. On your linux server, you can get this information in a couple of ways. The first would be to use the netstat command and grep for the desired port. For example: netstat -pane | grep 8888 and you should see the (LAN) IP address as well as the application/PID associated with your server application. This indicates that the game serve is running and that it is listening on the correct interface. Note, there may be a configuration parameter where you specify which interface to bind/listen to and you might need to ensure that this is correct, e.g. not localhost only.

One you know that this is working, you can use NMAP on your LAN IP and then again on your public IP to see if this port is open. It is effectively what the website you were using does. If you find that it is open when you scan your public IP, but the web tool does not report it being open, it indicates that something beyond your router is blocking the connection.
Thx for correction about the port scanning and not PING the ports;

Update: since i gave up trying to find a way to open the ports on the router, what i did was i changed to a direct connection from the modem (dismissing the router and creating a direct USB-DSL connection to the modem); the port 80 is closed, but i changed the listen port for website to 8080 and it works i can connect to the website on that port and all, port-scann port 8080 = open;

and server runs smoothly on the port 8888;

it really helped saying that i should start the server before checking for the port to be open or not.
because i was trying to see if it was open before starting the server.
Thx for all your help.

/Closed.
 
  


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
ssh conections icedude Linux - Networking 2 02-23-2006 05:10 AM
Internet Conections comenico SUSE / openSUSE 3 11-25-2005 01:25 PM
mgetty conections Buntoro Linux - Networking 1 10-21-2003 09:14 AM
limit number of conections a ip can use with wu-ftpd sooty Linux - Software 0 11-08-2002 05:52 AM
Sendmail wont take conections hubergeek Linux - Networking 3 03-14-2002 10:29 AM


All times are GMT -5. The time now is 11:13 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration