0

I have a computer that is connected to internet via Dynamic IP. So, I am not able to get connected via TCP/IP to my TCP/IP server program, which I've written C#, it works well by static IP though. I've decided to use IP forwarding DNS services on DuckDNS.Org and http://freedns.afraid.org/ to be able to ping my machine via a web address like: test.mooo.com.

Now it's okay I am able to ping my computer via this web subdomain but my question is:

How can I modify my client program that originally only deals with IP to connect to my computer which runs a server at a specific port to use the web address to get connected to my computer?

I've tried:

 client = new TcpClient("test.mooo.com", (int)Activity1.settingObj.port);

But it does not work. Thanks in advance. I'm using C# but I guess this is general TCP/IP question.

telcom
  • 145
  • 10

2 Answers2

1

Ping only verifies ICMP. That isnt TCP. Many firewalls are setup to respond to or pass through ICMP, even if nothing else is allowed.

Your PC is likely behind a NAT firewall / gateway. If you are using any sort of Linksys / Netgear type of DSL or Cable router, you'll need to check that it supports port forwarding. Usually you can setup a rule to forward a port to a single private IP address on your lan.

Also check firewalling on your PC itself. Verify that Windows firewall is disabled, or add a port exception.

In extreme cases, some ISPs block incoming connections as well, but this isn't usually true.

codenheim
  • 20,467
  • 1
  • 59
  • 80
  • thanks for the reply. Do you have any Idea why programs like Skype and Teamviewer can get through the firewall and static IP? Do they act like a webserver? – telcom Oct 24 '14 at 12:20
  • Their clients connect to a central server. The server is a fixed communication hub. It is how other concepts like "Push" work as well. It is really a "pull". A client from a private address can initiate from behind a NAT firewall to a public server, but not the reverse, unless the client has static NAT or port forwarding. – codenheim Oct 24 '14 at 12:26
  • okay it's true; I can initiate communication over NAT when my server is on computer with static IP. Now I have this problem that my server is on a dynamic IP. So, I guess I need to work on portforwarding. So far not getting good results. Do you have any suggestion to forward my IP to a static server? – telcom Oct 24 '14 at 12:52
0

After many struggles I had there are two ways we can make it happen. First when we are able to set the router setting to give us static IP, which in many cased it isn't possible. The second way is using VPN services that give us static "dedicated" IP. These services aren't free and monthly subscription fee is charged for this facility. However, it works. I've tried http://vpnstaticip.com/ They give a very limited trial period to test the vpn. I've tested and the result is great they give IP static. It worked for me although it's expensive and I need to see a good reason to use it.

telcom
  • 145
  • 10