When i try to connnect to a local IP everything goes wonderfully but as soon as i use a normal ip, like to connect to a friend of mine outside the lan it just doesn't work
A:
My first guess would be that you may be running into a firewall issue - is there a firewall operating between you and your friend? If so, do you have exceptions for it?
I suggest you use Wireshark to analyse what's happening at the network level.
Jon Skeet
2010-05-17 09:59:19
"No connection could be made because the target machine actively refused it IP:PORT" is the error
2010-05-17 10:11:54
@oidfrosty: That sounds like it's either a firewall issue, or you're not running the relevant app on the target machine.
Jon Skeet
2010-05-17 10:50:20
Or on the wrong port
Joren
2010-05-17 11:18:00
+2
A:
It's most likely a combination of firewall and port forwarding. In addition to opening up ports on your firewall, you'll need to forward these ports on your friend's router. PortForward.com is a decent resource if you're unfamiliar with port forwarding.
Stephen Cleary
2010-05-17 10:05:32
One other thing to check: make sure you're connecting to your friend's *public* IP address and not his *private* one. Visit [whatismyip.org](http://whatismyip.org/) from your friend's computer to verify his public IP. Also note that many ISPs change the public IP on a regular basis (mine does every day).
Stephen Cleary
2010-05-17 12:59:22