Having problems with port forwarding

bee_kay

Prominent
Jan 10, 2018
3
0
510
I'm new to such port forwarding stuffs(i.e. I haven't port forwarded a single port yet). My ultimate purpose for port forwarding is to forward the port to raspberry pi in order to remotely access it.
I have connected pi through the ethernet.
I haven't set the ip to be static (It would be helpful to know why we need to set the ip to static)
I have created a port forwarding configuration.
But whenever I try to access pi through remote desktop connection, the connection fails.
Also, checking the port through various online port checker results in a closed port.
 
Port forwarding is required when you are using NAT to allow a number of devices to use the internet with only public IP address and you want one of those devices to receive requests from the internet. Normally, a request to you public IP address will just be dropped. So, we setup a rule that if a request comes in on a certain port, that request will forwarded to device X that is on private IP address X.X.X.X . Now, most home networks use DHCP (Dynamic Host Configuration Protocol) to assign IP addresses to the internal devices. Since that assignment is dynamic, device X could be on X.X.X.10 one day and X.X.X.13 the next. If the IP address of your device changes, then the port forwarding rule (with a specific IP address) won't work. So, we use a static address that does not change (although, using a MAC-IP binding in DHCP will accomplish the same thing).

I have used the port checking websites and they will sometimes give a false negative. I like to use a smart phone so that I can quickly switch from inside the network (WiFi) to outside (cell network). Of course this only works if there is a phone app that will access your service.

So, on to the port forwarding.
First, I like to test my service from inside the network. This ensures the service is working properly.
Second, I test my service from outside the network. This tests my port forwarding rule.
What to do if the port forward fails...
1. Check the rule. Normally the incoming and outgoing port are the same. Do you need TCP, UDP, or both? Is it pointed to the correct private IP address?
2. Is there only 1 router between your device and the internet. If you have multiple routers, then you have forward multiple times (or something else).
3. Does your router keep a firewall log? Is your incoming request blocked and why?
4. Does your device have a firewall and could it be blocking your request? Disable the firewall and retest.

Let us know what you find out.