December 17, 2014 |
If you’ve ever wanted to log the IP addresses of Filemaker Clients connecting to their hosted system, but for whatever reason, did not want to use the logging capabilities of Filemaker Server, which can of course log these things.
Filemaker provides a number of Functions for calling the ‘System Address’ of a client machine “Get (SystemIPAddress)”, which will return a list of all the network addresses configured on the client machine, but they tend to be the local IP addresses. What I needed was a way for the clients to discern what external / WAN IP address they were using. (For more info on the difference between internal and external IP’s look here).
Fortunately, Filemaker now has the immensely useful Insert From URL script step, so we can use internet based tools like dyndns.org to get the information we want into a form that we can play with in filemaker.
Here’s how it works:
If you point your web browser at http://checkip.dyndns.org
You’ll see a very simple html page showing your WAN IP Address.
We can use the Insert From URL script step to populate a field in a Filemaker table:
Insert From URL [select ; No Dialog ; filemaker::field ; "http://checkip.dyndns.org" ]
and with a simple Filter function:
Filter ( filemaker::field ; "0123456789.")
We then have the WAN IP address, sitting on it’s own, in a Filemaker field. From here of course, we can then use this information to trigger notification scripts if the IP is not on a whitelist, or any thing else we need.
I would never recommend using this a security measure. There’s two easy ways to get around this logging, if you wish. First, with administrator level privileges, and Filemaker Advanced, a user could intervene in the script process, thus avoiding the logging. Also, there are ways in which the client machine could spoof it’s WAN IP, thus giving spurious results in the Insert From URL step. All in all, these are limitations of any client-side logging feature, so be sure to assess the potential impact before implementing…