|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Winsock problem...
I have a server and client app using winsock TCP ports.
If i use my class C network address on the LAN my client can talk to server and visaversa. My client can connect and get data from google.com on port 80. my router tells me it's extrnal ip address, and I set up a port forward for my port to my server machine, and all outgoing ports are open by default. If I use ShieldsUp to scan my port (16016) server gets a connection. But if my client tries to connect to port 16016 using the external ipaddress of my router it fails with error 10061 (No connection could be made because the target machine actively refused it) Telnet has the same issues, can connect on LAN but not WAN. ZoneAlarm is turned off, and windows firewall is also off. Can anybody help, even if only with more tests I could try? Could it be my ISP or choice of port number? Thanks |
|
#2
|
||||
|
||||
|
Sounds like your client is on the internal network and you're trying to connect using the external router address. Ask someone external to connect to your open port and see if it works.
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by Fishmonger, superior perl programmer of the month |
|
#3
|
|||
|
|||
|
Quote:
my client connects to google's server, and a connect attempt from the ShieldsUp website on my port number successfully connects to my server. Both client and server apps are on the same machine. I wanted to check I could connect to my server via the port forward I set up on my router, which works in the case of the ShieldsUp website. Am I missing something? |
|
#4
|
||||
|
||||
|
Just setup your client to connect to localhost, if it can connect then the port is open on your machine (at least to local connections). You can't expect it to route from your machine via an external router unless your client and your server software have different IP addresses. Better to test your client from a different machine, preferably one outside of your LAN if you must test connectivity from the internet.
__________________
My worst nightmare was a pointless infinite loop. Work in progress; don't poke the curmudgeon! http://www.odonahue.com/ |
|
#5
|
|||
|
|||
|
Quote:
I tested the port was open both locally and externally, both of which succeeded. I'll try an external machine, thanks for the help, I thought I was doing something in error. I suppose expecting a router to route packets to an IP address, is my error. On my pc I already know I can route packets from it's own ip to it's own ip, via localhost or it's LAN ip, but my router can't route from it's LAN ip to it's external ip then do it's own port forwarding? Sounds like lazy implementation by the router manufacturer to me, why am I not surprised? What would happen if I had a server on a machine on my LAN and a client on another machine on my LAN too? I guess you're saying if I got the ip for the server from an internet source, the client could not connect from my own LAN, because the router can't route to it's own external ip and back in to do the port forwards? seems odd behaviour to me. |
|
#6
|
||||
|
||||
|
No it's probably got nothing to do with the router. Perhaps I should ask for more details before I comment further...
Is your host dual-homed (two NIC's on separate LAN segments)? Is your client using DNS to find your host IP address? Is it succeeding? What is the current route from your client IP to your host IP? Does it include your router? Which side of the router would your client packets arrive on? Would that be the same side of your router that has the port mapping defined? Hmm... I should be able to think of some quesitons but that should get you going for now. |
|
#7
|
||||
|
||||
|
Doh! This thread really should be moved to an appropriate forum. There's no language specific issues here.
|
|
#8
|
||||
|
||||
|
That's exactly why I suggested getting someone external to try to connect to it. Quite a few routers will not route from internal to external to back to internal. With that said, I'm moving this to the networking forum.
|
|
#9
|
|||
|
|||
|
Quote:
My host is wireless to the router on my LAN. I specify the ip directly using dot notation but when I check what's happening using TCPView which does domain name lookup It correctly resolves the ip to a name. I can ping the router on it's internal and external ip and I did a tracert and it worked, and I think it only had one hop. my router will log when port forward rules are applied, and when I use shieldsUP I get a log from the incoming packet, but my client from my lan does not get logged. I'll do the external test as soon as I can. |
|
#10
|
|||
|
|||
|
Solved...
External clients can connect.
The router (netgear DG834GT)does not support loopback, and this is the reason I could not connect from my own lan on the external ip. Solution is to use the hosts table to resolve the domain name locally. Thanks for pointing me in the right direction. |
| Viewing: Dev Shed Forums > System Administration > Networking Help > Winsock problem... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|