Random Ports without Upnp

The problem is that because of the firewall , I can’t establish a connection with the remote server

They connect for seconds and immediately disconnect

I open all the respective ports in booth ends but they disconnect all the time , I am assuming because this random ports…

Thanks