Where does the Ignition client in Linux get it’s IP address info?
I thought it was the hosts file but changes to that do not seem to make a difference.
I am using Linux Mint 18 with Kernel 4.15.2
Ignition 7.9.5
I have a project that ties together IP address to a workcenter. Recent network changes are making hard coded IP addresses on the client a thing of the past, so I am writing a project to insert the IP address along with a dropdown selection, into a table for the assignemnt.
My project shows IP address from:
[System]Client/Network/IPAddress as aaa.bbb.ccc.165
ifconfig shows my IP address as aaa.bbb.cccc.169
My hosts file shows:
aaa.bbb.ccc.169 VPNLT398
This does not occur with the same project on a Windows client.
In the presence of multiple network interfaces somebody will always think the returned address is the “wrong” one.
With a little work you can write a script that enumerates the network interfaces, chooses the correct one for your deployment, and gets the address from that interface.
What I am telling you is that the IP address being returned by Ignition is wrong… I found the Windows PC that is the actual IP address: aaa.bbb.ccc.165.
My PC has an Ethernet IP address of aaa.bbb.ccc.169. So what I am telling you is that I find it strange that Ignition (via Java) is returning an IP address that is not in any way associated with my PC.
Yes, here is the ifconfig (Linux Client) It's a laptop. One Ethernet on the laptop (not used) one on the docking station (used) and 2 VMWare adapters (vmware not running). Just trying to unravel why a different IP address is being reported by Ignition (and not one of the ones in my system)
enp0s31f6 Link encap:Ethernet HWaddr 54:e1:ad:f2:05:0c
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:16 Memory:ec200000-ec220000
No luck. Shutdown completely, Rebooted, Reloaded Designer, still showing wrong IP under:
[System]Client/Network/IPAddress
Deleted .ignition, shutdown, restarted. Same issue
Deleted java cash, shutdown, restarted. Same issue.
This is not the end of the world, but certainly explains some issues I have had with a couple of terminals behaving in an abnormal manner.
I have existing Linux terminals (Circa 2014 running Java 1.6, Ignition 7.8.4, not sure Kernel) that are not having this issue…
Do you think trying an “old” version of Java may yield different results? Unfortunately it’s been 3.5 years since I have done any development work as it relates to client IP, but back then I know that the host file was the end all be all when it came to reporting IP address in Ignition.
Last time I messed with this stuff, I learned that the order in /etc/hosts matters. First, the machine’s dns name is determined, then that name is looked up, and the first entry that satisfies it is used. The lookup generally occurs with the short host name, not the FQDN. The line in hosts that has the IP address you wish reported as the primary address must be ahead of any other line that could match, including the localhost lines.