Ignition Changed SQL connection Port

Hi
We are using ignition vision 8.1.17 on windows server 2019.
It was noticed that after the reboot of Gateway VM, that TCP port which it was using to store data was 49738 after reboot it is changed to 49745. I can’t find any reference in the documentation what is the range of these ports so that we can open port range rather than configuring individual port.

The port used to connect to SQLServer is going to be part of the connection URL you configured on the corresponding database connection in the Ignition gateway.

TCP connections generally use an ephemeral port on the originator end for the return traffic (ephemeral == OS picks, not java). Is that what you are trying to nail down?

I thought maybe that’s what he was trying to ask also, but it seems weird to me that the error message would talk about the local ephemeral port and not the port it’s failing to connect to.

Thanks Kevin and pturmel,
My knowledge is limited on SQL connections and establishment side.
with our current setup we have to open the TCP port on SQL machine under windows firewall.

after looking at this error on ignition gateway. I believe TCP port 49745 or 49738 are dynamic port assignment? I don’t understand how Ignition gateway establish the communication and when it started using these TCP Ports to transfer the data. Or is it part of jdbc:sqlserver driver which does assingment of the TCP port for communications.

What i want to do is to setup the windows firewall with outbound /inbound rules for TCP ports range(49700 - 49800) to open. this way if the driver is changing the ports dynamically It shouldn’t stop communication to SQL database.

Normally SQL Server uses port 1433, but maybe you have it configured in such a way (named instances) that it’s using Dynamic Ports.

See Configure Windows Firewall - SQL Server | Microsoft Docs