# Any way to know what port the Ignition OPC UA server will use for a device connection?

**URL:** <https://forum.inductiveautomation.com/t/any-way-to-know-what-port-the-ignition-opc-ua-server-will-use-for-a-device-connection/41652>\
**Category:** Ignition\
**Created:** [December 18, 2020, 4:57pm UTC](https://forum.inductiveautomation.com/t/any-way-to-know-what-port-the-ignition-opc-ua-server-will-use-for-a-device-connection/41652 "2020-12-18T16:57:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [December 18, 2020, 4:57pm UTC](https://forum.inductiveautomation.com/t/any-way-to-know-what-port-the-ignition-opc-ua-server-will-use-for-a-device-connection/41652/1 "2020-12-18T16:57:52Z")

</div>

I am talking thru TCP driver. Over port 23.

Let’s say the server is 1.1.1.1 and the device is 1.1.1.2

So we set the device driver up to 1.1.1.2:23

Is there any way to know where the connection will come from? 1.1.1.1:5000 or is random and changes?  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/d/4ddabd5b472ea998b9f1ca75f81685817fa99efc.png)

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/4/d49cbdd06d5c1b51910956d31038f3d1ad5c427d.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 18, 2020, 5:01pm UTC](https://forum.inductiveautomation.com/t/any-way-to-know-what-port-the-ignition-opc-ua-server-will-use-for-a-device-connection/41652/2 "2020-12-18T17:01:51Z")

</div>

Pseudo-random. Google “tcp ephemeral ports”.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [December 18, 2020, 5:01pm UTC](https://forum.inductiveautomation.com/t/any-way-to-know-what-port-the-ignition-opc-ua-server-will-use-for-a-device-connection/41652/3 "2020-12-18T17:01:54Z")

</div>

No, it’s unknown (an [ephemeral port](https://en.wikipedia.org/wiki/Ephemeral_port)).

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [December 18, 2020, 5:05pm UTC](https://forum.inductiveautomation.com/t/any-way-to-know-what-port-the-ignition-opc-ua-server-will-use-for-a-device-connection/41652/4 "2020-12-18T17:05:20Z")

</div>

Lol I figured.

Would it be a waste of time If I summited it to ideascale? I suppose it wouldn’t be trivial to add a configurable block of ports you could use for connections like this. From the server side.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 18, 2020, 5:08pm UTC](https://forum.inductiveautomation.com/t/any-way-to-know-what-port-the-ignition-opc-ua-server-will-use-for-a-device-connection/41652/5 "2020-12-18T17:08:58Z")

</div>

The ephemeral port is chosen by the operating system, not by an application. Some operating systems allow you to constrain the range, but I’ve only seen it for global effect on _ **all** _ TCP traffic.

~~Note that _both_ ends normally end up on an ephemeral port–the “23” is used just for the first packet in typical applications.~~

~~Tools like wireshark will remember what port was used to open a connection and will keep the connection’s packets together. As long as it sees that first packet.~~

Hmmm. Learned something new today.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [December 18, 2020, 5:13pm UTC](https://forum.inductiveautomation.com/t/any-way-to-know-what-port-the-ignition-opc-ua-server-will-use-for-a-device-connection/41652/6 "2020-12-18T17:13:44Z")

</div>

> [@pturmel](#):
>
> As long as it sees that first packet.

It doesn't need to see the first packet, it sees the destination port in the TCP header.

It's very common to have functional captures that didn't capture the connection being made.

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [December 18, 2020, 5:14pm UTC](https://forum.inductiveautomation.com/t/any-way-to-know-what-port-the-ignition-opc-ua-server-will-use-for-a-device-connection/41652/7 "2020-12-18T17:14:02Z")

</div>

Guess I should use your EthIP driver instead with these devices 😆

As always thank you for sharing your seemingly endless knowledge!!
