# Component Scripting - Tag Change based on Client IP

**URL:** <https://forum.inductiveautomation.com/t/component-scripting-tag-change-based-on-client-ip/84765>\
**Category:** Ignition\
**Tags:** scripting, vision, ignition81\
**Created:** [January 25, 2024, 2:13pm UTC](https://forum.inductiveautomation.com/t/component-scripting-tag-change-based-on-client-ip/84765 "2024-01-25T14:13:55Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [January 25, 2024, 2:27pm UTC](https://forum.inductiveautomation.com/t/component-scripting-tag-change-based-on-client-ip/84765/2 "2024-01-25T14:27:59Z")

</div>

I recommend basing Vision client identity on the MAC ID of the network adapter that is used to communicate with the gateway. Works even if your IT group screws with the IP addresses. In some environments (Linux, easily), you could also use motherboard serial numbers.

See this topic for MAC ID retrieval:

> [@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…

You can then look up in a database (or just a list of constants) in a client startup event to drive your machine-specific permissions. (I recommend Vision Client tags to hold the resulting decision.)

---

_[View the full topic](https://forum.inductiveautomation.com/t/component-scripting-tag-change-based-on-client-ip/84765)._
