We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

TCP Cannot accept WAN requests

Medium Priority
552 Views
Last Modified: 2013-11-29
Hi Experts,

I have a server and client (both written in C#/.net). When i run the server and do a netstat, I can see that the port is being listened too. When i attempt to access the server via the client from inside my network or on my local machine, it works perfectly. When i attempt to access it via wan-ipaddress:port, the server doesnt seem to be accepting any connections.

So essentially, i can connect inside my network but not outside. I am behind a router (but port forwarding is set correctly and firewall is disabled). Also, I have tried this while not behind a router and it still can only connect from the same machine that the server is running on.

Any suggestions?

Best,
Avery
Comment
Watch Question

What IP address are you using locally? 127.0.0.1 or something else?

Author

Commented:
Locally the server is running on "localhost" which is 127.0.0.1

Best,
Avery
OK, so have you configured port forwarding to forward to 127.0.0.1 or localhost?  If so, you need to change that to your LAN ip, which can be determined by typing "ipconfig" at the DOS prompt.

Author

Commented:
Port Fowarding IS forwarding to my LAN ip!! Hence why i cannot figure out what is goign on!

Best,
Avery
So much for an easy solution! :-D

What happens when you try to connect to your LAN ip rather than localhost?  Does that work?

Author

Commented:
Yes - when i run the client within the network...accessing the computer where the server is running (with its network address) that works PERFECTLY. The only problem is accessing via WAN!

sigh! ITS SO FRUSTRATING!

best,
avery
Yes, I know the feeling!  When you removed the router from the mix did your computer pick up its new public address before you tested?  If it did, and it still didn't work, then perhaps your ISP is blocking certain ports.  Can you change the port number to something common, like 80, or 110?
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
this could be the problem with your server not having a return path to the internet . Have you set your default gateway on the
server to point to this router ?? Can u ping a system on the internet from inside your network .
 Do a tracert -d on a test system which you may use to connect from ouside your network . if the route is through this router of yours then I think connectivity part is OK .
 

Author

Commented:
Hi Guys,

Thanks for all your efforts thus far - I have not realized the "loopback connection" issue. The situation has changed like this:

1)I can access the server running the client with there server IP as localhost
2)I can access the server running on the same network.
3)Someone completely outside my network can access the server via its WAN IP
4)someon INSIDE the network can NOT access the server via its WAN IP

This must mean the problem is infact a "loopback" connection. -> I must - must - must - must get around this. How do i do it?

Thanks so much,
Avery
What you need to do here is to have route on each m/c to this wan IP address , if the router which forwards the IP is not the default gateway for all the computers on your network .
eg if the said router is the default gateway for all your clients the site will open with the wan IP .

If you dont want to make the router the default gateway then you can use this route add command on all the PC .

route add -p WAN_IP ROUTER_IP

so next time they use they use the WAnN IP they will be routed through the router .
Top Expert 2004
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Here's an idea.

What if you set up a switch or hub before that is setup before the router.

I assume your network looks like this.

internet>DSL/cable modem>router>internal network

You didn't mention if you had a DSL/cable modem so just remove it from the explanation if you don't have one.

you would set up the hub or switch before the router.

internet>hub/switch>DSL/cable modem>router>internal network

you could then attach a computer with two network cards, one connected to the internal network and the other to the hub/switch.  

I never done this so I don't know how or if it would work

Ed


Author

Commented:
Hi Guys,

Thanks for all your help. In the end i accepted the answer about loopback connection - with the most points because that is what led to me being able to solve the problem. The answer about having internal clients connect to the LAN IP got 50 points because that is EXACTLY what I am ending up doing, although, I did think of it myself before the answer was posted -  I do think it warrents some points.

Thank you all SO much!

Best,
Avery
Top Expert 2004

Commented:
Thanks Avery.  :)
Well somehow I cannot accept this . I have seen 100s of network & if the router is configured properly giving the wan address from the internal network will work . It is not a loopback , but NAT is translating the wan IP request to the internal ip . Unless a firewall or access list denies this ,it is always possible to access the public IP from the internal netwrok .
Top Expert 2004

Commented:
Well, like I said - why not have the internal clients connect to the internal LAN IP?  Could have a split DNS with private IP's inside and Public Natted IP's outside.
Avery,

Did some more research on this matter, since it still seems to be open.

http://www.dyndns.org/support/kb/loopbackconnections.html

Ed
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.