Sunday 15 April 2018

How to find out Start Port and Finish Port settings for port forwarding?


I'm trying to set up port forwarding on my router so that my computer's local development environment is externally accessible.


My router is a Sky box and my local development environment is MAMP. My local development url is localhost:8888.


On the router I've set up a custom service of port forwarding. It includes TCP and UDP. I need to enter a number for the 'Start Port' and 'Finish Port'. How do I find out what this should be?


Currently they're both set to 8888 but it doesn't appear to be working. I tried changing them to 80 but then I get the error message 'Sorry, The selected service is used by the firewall!'.


UPDATE So currently my set up is:


The url for my local development environment is (and always has been) http://localhost:8888/


In the router I've added this:


Services: Add Custom Service - PORT FORWARDING  
Type: TCP and UDP
Start Port: 8888
Finish Port: 8888

And this:


Firewall Rules - Inbound Services
Service: (ive used the service created above)
Action: Allow always
Send to LAN Server: (this is my computers IPv4 address)
WAN Users: Any

I can access my development environment via http://my-ip-number:8888/ as well as http://localhost:8888/ from the local computer.


I thought that http://my-ip-number:8888/ would now be available externally but when I try with hidemyass.com It says 'The port specified is invalid.'.



Answer



The answer depends entirely on the protocols that you wish to forward. some protocols occupy multiple ports (FTP for instance), whereas many (most) others use a single port. if I wanted to forward SMTP traffic for instance, I would create a rule where on the outside the start and finish ports are both TCP\25, and on the inside the rule points to your local mail server on port TCP\25. if I wanted to do FTP however, I would set my outside start port to 20, and the end port to 21. if I wanted HTTP and HTTPS I would write two different rules, one with start and finish of tcp\80, and another with start and finish set to tcp\443 since the ports are non-contiguous.


In your case, I'm assuming you wish to forward HTTP services, so since port 80 is taken by your router, you will have to either forward inbound requests for 8888 to your internal server at port 80, or you will have to set apache to occupy port 8888.


Most likely you do not need UDP forwarding, and I urge you to disable it unless you know you need it.


when in doubt, check http://portforward.com/ for instructions on how to set up port forwarding for your specific model of router.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...