Network.player.externalIP returning localIP

Hey there i’m just fooling around with the Network system of unity. And yesterday i was working on my laptop and made a connecting and hosting part and it would write my externalIP on the console.
works perfectly builded it connected to the external ip of my laptop.

Now i’m on my work computer and i tried the same project on there though it doesnt seem to work at all it will either return my LocalIP or ‘UNNASIGNED_SYSTEM_ADDRES’

Any help is appreciated tnx.

Things i’ve tried on my computer :

Opening port on router and Turning off firewall

Even tough my laptop has its firewall
on and no portforwarded ports on it

How am i connecting / creating network

`
public void HostServer()
{
bool useNat = !Network.HavePublicAddress();
Network.InitializeServer(2, 25080, useNat);
}

void OnServerInitialized() 
{
	Debug.Log ("Created on IP:" + Network.player.externalIP + " Port:" + Network.player.externalPort);
	Application.LoadLevel("LobbyMP");
}

public void JoinServer(Text text)
{
	Network.Connect(text.text, 25080);
	Debug.Log (text.text);
}

void OnConnectedToServer()
{
	//Connected to a server
	Application.LoadLevel("LobbyMP");
}

`

That might be because you are connected locally to the server. AFAIK You can’t connect to your own server if it is on the same computer.

Asked a current Unity Developer on my skype list he got me some information about this and basicly to just get ExternalIP from myself would be doing the code below before starting the server.

Network.Connect("www.google.com"); string externalIP = Network.player.externalIP; Network.Dissconenct();

Also if i’d want people to connect to it they would have to port forward or i’d have to setup UPNP theres a asset called ‘TNET’ that does this for me.

Conclusion : If you want just LAN Multiplayer server this could be perfectly fine. If you’d wanna share it with online friends use a provider like Hamachi or Tunngle.

Making it with an externalIP means that the host player has to portforward