Forum > Networking and Web Programming

[SOLVED, THANKS FOR HELP] Port Forwarding Help

(1/3) > >>

Jishaxe:
Hello people. I need help, please.
I am building a pair of applications, one the server to go on my computer, and the client to go on a friends computer, which is far away from where I live. The client is designed to connect and send data over the Internet to my computer, but I need to set up port forwarding on my router.
The question is:

How exactly do I set up port fowarding on my router JUST for sockets on applications? I looked at www.portforward.com but they only have instructions for games. Any help and/or links would be appreciated.
Thanks in advance.
- Josh Lee, Lazarus programmer

IndianaJones:

In your modem settings, you just need to enter three things for port forwarding.
The server IP, Protocol type (TCP, UDP or TCP&UDP) and port (which your application use it).
In my modem settings, there is an option under the NAT. In this option which ic Port Forwarding just enter the given information.
Anyway if you dont mind can you share the source code with other lazarus users?
Thanks.

Jishaxe:
Thanks for your help, just a few more questions if you would be nice to answer them please.
I'm a desktop programmer, but starting to move on to network programming.

--- Quote ---The server IP, Protocol type (TCP, UDP or TCP&UDP) and port (which your application use it).
--- End quote ---
So as long as all my applications use the same port, they would be allowed through?

Also, what do I need to make a simple pair of applications that exchanges strings over global Internet? A static IP? And

--- Quote ---The server IP,
--- End quote ---
How do I obtain this?
I'm sorry, I'm very basic on networking and need clarification please.

IndianaJones:

If I understand your reply clearly, my port definition in here is different than yours. I mean, the port is a number which server side use for listening incoming client request. (like ssh using 22).
For the second question, where is your server side application running? The server program runs on a machine so that's your server ip address. To obtain the server ip if it is a Linux machine open a terminal and execute the following.

ifconfig -a

If your server side machine is a Windows machine then open a terminal and execute the following command. (start/run/cmd/ok)

ipconfig

I hope this will lead the way, if you have a problem feel free to ask.
Thanks.

Martin_fr:

--- Quote from: Joshuzzz on June 28, 2010, 10:39:33 am ---I'm a desktop programmer, but starting to move on to network programming.

--- Quote ---The server IP, Protocol type (TCP, UDP or TCP&UDP) and port (which your application use it).
--- End quote ---
So as long as all my applications use the same port, they would be allowed through?

--- End quote ---

If you want to run your apps in parallel, then they can not use the same port.
(That is for the server apps, that is / The client app you do not worry about the port. It get's it automatically, and you will never notice)


Also before you come to port forwarding. The client app on your friends pc must know the IP that you have. And normally you have more than one.

1) Your router get's an IP from the Internet provider you use. This IP of the router is a public IP, to which you friend can connect.

2) Your PC gets a private IP (usually 192.xx.xx.xx), that your friend can never see. Only your router can see that.

That is why you tell your router to forward stuff.

Problem is that the public IP that your router has can change. (Some provider offer you a static IP for extra money).
It is easier to use something like dyndns. Many routers have buid in support for that.

The port forwarding depends a lot on your router.

Some router you can give a name to your PC, and tell the router to:
- listen to port XX
- forward to port ZZ on "name/device" (ZZ can be equal to XX)

With other routers you must specify an IP (instead of a named device).
Then it is better to configure your PC with a fixed IP, instead of using DHCP
- If you need help on this, you need: your routers internal IP, the netmask, and the DHCP range. From that people can tell you what to set up on your PC

Navigation

[0] Message Index

[#] Next page

Go to full version