# Mobile Client MAC Address

**URL:** <https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037>\
**Category:** Ignition\
**Created:** [March 4, 2019, 6:39pm UTC](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037 "2019-03-04T18:39:28Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![rrowe](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@rrowe](https://forum.inductiveautomation.com/u/rrowe)\
**Post date:** [March 4, 2019, 6:39pm UTC](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/1 "2019-03-04T18:39:28Z")

</div>

I know that I can get the client IP Address in a tag, but I would like to see if I can do the same for a Client’s MAC address.

Anyone know of any ways of obtaining this perhaps via scripting with some python modules?

---

<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:** [March 4, 2019, 6:44pm UTC](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/2 "2019-03-04T18:44:39Z")

</div>

It should be available in the same System Tag folder as the IP address.

[System]Client/Network/MACAddress

---

<div class="post-metadata">

**Author:** ![rrowe](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@rrowe](https://forum.inductiveautomation.com/u/rrowe)\
**Post date:** [March 4, 2019, 6:45pm UTC](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/3 "2019-03-04T18:45:54Z")

</div>

I forgot to mention that these are mobile clients, so I don’t think that method will work because these clients run in a JVM on the gateway.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 4, 2019, 6:49pm UTC](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/4 "2019-03-04T18:49:12Z")

</div>

No, you don’t have access to this information through a mobile Vision client, unfortunately.

---

<div class="post-metadata">

**Author:** ![rrowe](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@rrowe](https://forum.inductiveautomation.com/u/rrowe)\
**Post date:** [March 4, 2019, 6:53pm UTC](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/5 "2019-03-04T18:53:29Z")

</div>

@paul-griffith Is there any way (other than IP address) to uniquely identify a device that is launching a mobile client?

---

<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:** [March 4, 2019, 7:02pm UTC](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/6 "2019-03-04T19:02:52Z")

</div>

Anything but the IP address can be spoofed or blocked by browser privacy tools and settings. And even the IP address may not be unique, if multiple clients connect from behind a NAT router.  
Note that this is also true for v8’s Perspective in a browser.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 4, 2019, 7:16pm UTC](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/7 "2019-03-04T19:16:35Z")

</div>

Not to consistently identify the actual device that’s connecting. Your individual session will have a unique ID on the gateway, but that’s probably not what you’re actually looking for.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [August 7, 2019, 1:11pm UTC](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/8 "2019-08-07T13:11:12Z")

</div>

I’m looking at a similar situation. I’m running a regular vision client on a RPi, and was looking to identify the hardware by the mac address. I have a label bound to the client mac address and it shows up null. I have another label bound to the client ip address and it shows up as 127.0.1.1 which does not match the ip address shown on the gateway associated with this client.

---

<div class="post-metadata">

**Author:** ![jlivingston](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jlivingston](https://forum.inductiveautomation.com/u/jlivingston)\
**Post date:** [August 7, 2019, 1:43pm UTC](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/9 "2019-08-07T13:43:29Z")

</div>

In answer to both questions, the answers are to be found in the following abbreviations: A.R.P. and R.A.R.P. This is to say, that routers and such use Address Resolution Protocol and Reverse Address Resolution Protocol to query a given I.P. Address or MAC address if given the other one. Because you are frequently dealing with situations like D.H.C.P. ( Dynamic Host ) where the IP address changes according to what address just happens to be unused in a pool, you could obtain a list of possible MACs given a ‘nearby’ connection was made. With multiple machines and added Authentication, you have pretty slim chances with a mobile client. This can theoretically happen, yet I would not want to wait for a result or trust it through a WiFi system. Nearby means on the same physical Ethernet segment, etc. If you knew enough about the machine, you might start be reading the following forum post: [Windows CPU Temp](http://forum.inductiveautomation.com/t/windows-cpu-temp/26114) where bvaldinos asked about remotely reading temperature from a connected machine. Mr. Zx… knew of a Vision ( not Perspective ) way to query the hardware, and the similar post ( battery percentage ) has a link to a website with more information about hardware queries.

---

<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:** [August 7, 2019, 1:56pm UTC](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/10 "2019-08-07T13:56:43Z")

</div>

In a **real** Vision client, you can obtain the local MAC addresses with the following script:

```auto
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 client uses to talk to the gateway with this script:

```auto
from java.net import DatagramSocket, InetAddress, NetworkInterface, URI

# Get the outbound network interface and local IP address (as a tuple).
def localInterface():
    gw = URI(system.tag.read('[System]Client/Network/GatewayAddress').value).host
    for ip in InetAddress.getAllByName(gw):
        socket = DatagramSocket()
        try:
            socket.connect(ip, 0)
            return NetworkInterface.getByInetAddress(socket.localAddress), socket.localAddress
        except:
            pass
        finally:
            socket.close()
    return None, None

```

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [August 7, 2019, 2:16pm UTC](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/11 "2019-08-07T14:16:07Z")

</div>

Very much appreciated, you impress me sir. 🙂 I will have to get into learning more of the java side of Ignition.

---

<div class="post-metadata">

**Author:** ![jlivingston](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jlivingston](https://forum.inductiveautomation.com/u/jlivingston)\
**Post date:** [August 7, 2019, 2:35pm UTC](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/12 "2019-08-07T14:35:38Z")

</div>

Re: dkhayes117 response to Pturmel Vision answer: Ditto ( appreciated ). Re: Original post number 2 mobile clients- summary: “No”, yet hope always reigns- slim though it may be. Last idea- if the real idea behind this is finding a way to Authenticate your own _authorized_ employees and/or management mobile devices, you might want to look at methods of finding other information on their devices- version of IOS or Android, etc. because while they can ‘spoof’ a MAC or IP Address- they typically will have just one mobile device that is authorized for remote access. It has a profile that can be seen if ‘read e-mail headers’ is enabled for detail. While it can also be ‘faked’, folks generally ignore the source information.
