# Getting Vision Client IP address with multiple Adapters

**URL:** <https://forum.inductiveautomation.com/t/getting-vision-client-ip-address-with-multiple-adapters/65478>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [October 20, 2022, 5:35pm UTC](https://forum.inductiveautomation.com/t/getting-vision-client-ip-address-with-multiple-adapters/65478 "2022-10-20T17:35:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [October 20, 2022, 5:35pm UTC](https://forum.inductiveautomation.com/t/getting-vision-client-ip-address-with-multiple-adapters/65478/1 "2022-10-20T17:35:56Z")

</div>

Trying to set the default screen for a Vision client on startup using the IP address, but even though the PC has two ethernet ports with only one that can connect to the gateway, the client tag for IPAddress and system.net.getIpAddress both are returning the IP address on the port not connected to Ignition.

Any ideas on how to get the other address? Or even both IP addresses?

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [October 20, 2022, 5:41pm UTC](https://forum.inductiveautomation.com/t/getting-vision-client-ip-address-with-multiple-adapters/65478/2 "2022-10-20T17:41:01Z")

</div>

You can enumerate network adapter and ip with java. Those function return as well virtual adapter

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [October 20, 2022, 5:41pm UTC](https://forum.inductiveautomation.com/t/getting-vision-client-ip-address-with-multiple-adapters/65478/3 "2022-10-20T17:41:05Z")

</div>

Think I've got it figured out. I switched to using getExternalIpAddress instead. Now I get the IP from the gateway POV.

---

<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:** [October 20, 2022, 8:03pm UTC](https://forum.inductiveautomation.com/t/getting-vision-client-ip-address-with-multiple-adapters/65478/4 "2022-10-20T20:03:53Z")

</div>

That breaks if there's any NAT between the client and the gateway. Consider this technique:

> [@Mobile Client MAC Address](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/10):
>
> In a real Vision client, you can obtain the local MAC addresses with the following script: from java.net import NetworkInterface # Get list of local mac address as strings def myMacIds(): macs = [ni.hardwareAddress for ni in NetworkInterface.getNetworkInterfaces() if ni.hardwareAddress] return [":".join(["%02x" % (b & 0xff) for b in mac]) for mac in macs] Also, again in a real Vision client, you can obtain the outbound network interface and the corresponding local IP address the clien…

Note the use of a fake UDP connection (no actual packets sent) to coerce the OS to expose the source interface and IP selected for the route to the Ignition Gateway.
