tags:

views:

43

answers:

2

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
"No connection could be made because the target machine actively refused it IP:PORT" is the error
@oidfrosty: That sounds like it's either a firewall issue, or you're not running the relevant app on the target machine.
Jon Skeet
Or on the wrong port
Joren
+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
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