unity client is acessing from what port? (what port to set in router)

I’m trying to configure out the router we have at our house but I’ve came to a problem, I thought I only need to give it port from witch I’m receiving the messages, but now I see I need to give it port from what I will receive messages as well, …

so, … what should I choose? other applications? or…?

and that what should I give for from port? through port is probably 25001 and so is to port. right?

Server Script:

	public int Port = 25001;

	void Start(){
		Network.InitializeServer(10, Port);

Client Script:

	public string IP = ""; // server IP
	public int Port = 25001; // Open Port to server

	void Start (){
		Network.Connect(IP, Port);


and at protocol I should use TCP right?

there are options:

  • TCP
  • UDP
  • ESP
  • GRE

thanks in advance

Yes UDP. The from port is the port you’re expecting to receive on. The to port should probably just be the same. But what it’s asking you is if you want to change the port along the way.

External application → Router IP/Port → destination in network IP/Port

If you wanted you could say any requests coming in the router on port 1, can be forwarded on to another machine at port 2. But in your case just keep them all the same since the server is listening on 25001 and the client is is trying to connect on 25001