Unity connection sucks or i sucks

Hi guys i have a problem:
when some of my friend make a room(so intialize the server), i can’t connect on it.
But with other friend ,works so i can connect…
So what’s the problem ,why unity connection works only in some case??
TO INTIALIZE A SERVER I USE THIS:

Network.InitializeServer(4,25000,!Network.HavePublicAddress());

AND TO CONNECT

foreach(HostData match in MasterServer.PollHostList()){
GUILayout.BeginHorizontal(lobbyroom);
	if(GUILayout.Button(new GUIContent(match.gameName))){			
				Network.Connect(match);
				}
}
GUILayout.EndHorizontal();

Wher is the problem??? unity connection work only in some case???How i can solve the problem???
Thanks anyway

i use c#

The problem is most likely with the router or firewall. You have to forward your ports if you are behind a router, and allow the application on your firewall (or turn it off, but I don’t recommend that). http://www.portforward.com is a website to help you forward your ports. Good luck mate.