Sorry for resurecting a month dead thread but i'm having this exact same problem. I have correctly set up port forwarding to forward my outgoing ip address (the router one) on ports 3000-3050 to go to my static ip of 192.168.0.136. I listen to port 192.168.0.136:3000 but the client when sending through the router's ip and port 3000 gives a "Connection refused actively". It works fine using the LAN ip. Could someone give some help on this subject
Port forwarding is only needed when you need to connect to a Server which is behind some router.
Example:
Server is listening on Port 37000 on some computer with Local IP address 192.168.0.20.
Client1 needs to connect to that server, What it'll do because Server Doesnot have a global IP. Client will connect to a Router on Port 37000. Now Your Router needs to be configured in such a way that whenever a reuqest to make a connection comes for Port 37000 it should be forwaded to Computer with IP Address 192.168.0.20.
So the conneciton is done in such a way.
Of course the port on Local Computer should also be opened so that it can accept an incoming connection.
So all you need is to forward a port from Router to a Computer in a LAN.
This cannot be achieved programatically, You need to study your Router's Manual and do this manually, This is really a simple procedure. Wish you best of Luck.
Thanks a lot for your interesting to help me but, when i was creating my C# program and used specific port number, then i opened this ports on my windows, and make forwarding this port on my router but the program failed to connect , although when i used the normal connection for the same ports using my static IP the program work then without any faults, so I think there are one or more step i need to modify my program code to make it work and support the port forwarding, I'm waiting for the help what i need.
I did this forwarding but the connection doesn't work, althougt I'm sure that my program is work proberly becuse it's success to connect to a real IP, and i did the port forwarding in my router to my lan pc IP but the program failed to complete the connection again. I think I need some commands in C# code to make my program suppurted to traeate with the port forwarding in the routers. hope u can give me useful help for this problrm
Can one help me
Alan Robbins
developer00x
Port forwarding is only needed when you need to connect to a Server which is behind some router.
Example:
Server is listening on Port 37000 on some computer with Local IP address 192.168.0.20.
Client1 needs to connect to that server, What it'll do because Server Doesnot have a global IP. Client will connect to a Router on Port 37000. Now Your Router needs to be configured in such a way that whenever a reuqest to make a connection comes for Port 37000 it should be forwaded to Computer with IP Address 192.168.0.20.
So the conneciton is done in such a way.
Of course the port on Local Computer should also be opened so that it can accept an incoming connection.
So all you need is to forward a port from Router to a Computer in a LAN.
I hope this will help.
Best Regards,
Rizwan aka RizwanSharp
Mark_Davies
This cannot be achieved programatically, You need to study your Router's Manual and do this manually, This is really a simple procedure. Wish you best of Luck.
Best Regards,
Rizwan aka RizwanSharp
SineStar
Khass