|
-
Jul 21st, 2008, 02:22 PM
#1
Thread Starter
Addicted Member
[2008] Testing Port Forward
I need to develop a very easy to use application that can 100 % test router port forwarding for a specific given port. For example, the user enters the port number, and the program will test to see if the port is open for incoming and outgoing connection (to check if the port forwarding worked correctly), can anyone help me start this or guide me where to read to solve this?
Thanks
Im using Visual Studio 2008 Professional Edition
.Net Framework 3.5
-
Jul 21st, 2008, 02:28 PM
#2
Re: [2008] Testing Port Forward
To the best of my knowledge, you need an external web site like this in order to see if incoming connections can go through your router.
To test for outgoing connections, you'll need to use the System.Net.Sockets namespace. All you have to do is try to establish a connection with a known server on the port you want to test and you know that the server is listening on.
-
Jul 21st, 2008, 04:07 PM
#3
Thread Starter
Addicted Member
Re: [2008] Testing Port Forward
I want to make a VB program that does exactly what the first link you provided does. Is it possible in VB ?
Im using Visual Studio 2008 Professional Edition
.Net Framework 3.5
-
Jul 21st, 2008, 04:35 PM
#4
Re: [2008] Testing Port Forward
You can code something like that using VB.Net easily. All you have to do is open a socket from the server to the client.
BTW, you'll also need to deploy on an ASP.Net host. You can't do something like that on your own computer...unless you want to expose your box to the internet.
-
Jul 22nd, 2008, 09:38 AM
#5
Thread Starter
Addicted Member
Re: [2008] Testing Port Forward
could u explain that more ? and give me a starting point (a guide or something ?)
I mean, why do I need to deploy any host ? All im trying to do is check if a port is port forwarded correctly or not.
Im using Visual Studio 2008 Professional Edition
.Net Framework 3.5
-
Jul 22nd, 2008, 01:33 PM
#6
Re: [2008] Testing Port Forward
Let's consider a practical example by saying that you want to check whether the port for eMule is being forwarded appropriately. eMule needs to be able to accept connections from other computers on the internet. When that happens, a remote computer tries to connect to a specific port on your IP address and goes through your router. The router in turn is being configured to know that if some external computer tries to connect to it on that specific port, then it should pass that connection to another computer that resides in your internal network.
So, in order to properly check if a port is being forwarded correctly, you would need some program that resides outside your internal network to try to connect to that port. In order to do that you need two things:
1. One program on the computer where the port is being forwarded to (internal network) that is listening on that port.
2. One program on the internet that tries to connect to (1).
That is why I am saying that you will most probably need to deploy program #2 somewhere on an ASP.Net host - so that the program is running at the internet and can check for open ports (and therefore correct setup of port forwarding). If that's not clear, try reading this article.
As to where you can start, as I said you need to have a look at the System.Net.Sockets namespace. You may google for code samples (such as this) but I would also recommend that you take the time to familiarize yourself with this particular namespace.
-
Jul 22nd, 2008, 02:10 PM
#7
Thread Starter
Addicted Member
Re: [2008] Testing Port Forward
this might be stupid question, but ill ask it anyway,
so you are saying that
ASP.Net Host >(send signal)> internet >> router >> my program
if the program recieves it = port forwaded successfully, else something wrong.
Right?
can I do this ?
my program >(sends a signal)> internet >> router >> internet >> my program
(basically Im sending a signal using the port to test it)
is it possible?
Im using Visual Studio 2008 Professional Edition
.Net Framework 3.5
-
Jul 22nd, 2008, 02:14 PM
#8
Re: [2008] Testing Port Forward
 Originally Posted by perito
this might be stupid question
According to my experience, there's no such thing.
 Originally Posted by perito
so you are saying that
ASP.Net Host >(send signal)> internet >> router >> my program
if the program recieves it = port forwaded successfully, else something wrong.
Right?
Right.
 Originally Posted by perito
can I do this ?
my program >(sends a signal)> internet >> router >> internet >> my program
As long as the program on the left is not on the same local network as the program on the right, you can do it. Just to illustrate, the following is possible:
your program at work > generates a connection request > work router > internet > home router > your program at home.
The following is not possible:
your program at home > generates a connection request for another computer on the same internal network> home router >....
and at this point the router typically discards the connection request because for most routers port forwarding means listening on the internet side for a connection but not from the local network side.
-
Jul 22nd, 2008, 02:26 PM
#9
Thread Starter
Addicted Member
Re: [2008] Testing Port Forward
ok, thanks alot.
Ive found a program called Blue Port Scanner, I'm just wondering:
1) can I, how can I do such program in VB.NET
2) if I make this program scan a specifc port on the address 127.0.0.1, will it tell me if the port is forwaded correctly or no?
Im using Visual Studio 2008 Professional Edition
.Net Framework 3.5
-
Jul 22nd, 2008, 02:49 PM
#10
Re: [2008] Testing Port Forward
If you run the port scanner from inside your local network then no, it will not. It will tell you which ports is your computer listening on but it cannot tell you if the port is being forwarded correctly by your router.
If you run the port scanner from a computer that resides on the internet and tell it to scan your home IP then the scanner will show you what ports is your computer listening on and are being forwarded by your router.
Note that a port scanner is more like a security/hack tool. It is geared towards finding what ports is a computer listening on (and therefore what services are available on the computer) than determining if a port is being forwarded correctly.
You can create a port scanner in VB.Net. How effective (i.e fast) it would be depends entirely on how much effort you put into it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|