Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.