03-17-2015 05:55 AM
This should be doable on Linux RT targets I guess (even on the primary NIC then too), but is there a way NI would recommend doing it?
Normally I use the System Configuration API to change these things, but if I wanted to do it on the fly like this I guess I would need to do it under the hood instead, or?
03-19-2015 01:38 PM
The System Configuration API allows you to change the NIC configuration without a reboot on Linux RT targets, so no need to make changes under the hood.
03-26-2015 10:19 AM
Thanks for the reply.
One thing I noticed about this was that I seemingly had to do a reset after all...until I found out that the reason I can still access the old IP after a change here, is that the ARP lookup table still directs the old IP to the correct MAC address. It does not get refreshed.
- If I disconnect the device from the network then reconnect it, the ARP tables are updated and the new IP works. So no restart of the Linux target, but I now need to manually unplug and plug the NIC to refresh of the ARP cache.That's not an acceptable requirement(!)... If the configuration is updated the NIC should automatically go off- then online again at least - to initiate an ARP update, should it not? What is missing
I tried doing the change with the system config API in two steps, where I disable the interfasce first, then reenable it. Hoping that this would force a refresh, but that does not cut it...
03-26-2015 10:57 AM
I guess this is the same issue...and the solution should be that the network card enforces an ARP update...but how can we get that done, is it doable from the System Configuration API?
03-26-2015 05:12 PM
Just to be clear, are you referring to the ARP tables on the RT target or on the host? After you modify the secondary NIC configuration, are you trying to connect to the target from the host using that NIC? It would help if you can tell me a bit more about your system configuration network layout.
The System Configuration API does not provide a way to do an ARP update. A workaround would be to use LV system exec VI to run a command on the target that does what you need.
03-27-2015 03:33 AM
The problem is that the RT target does not indicate in any way to the network that it has changed its configuration, so none of the "hosts" will update their ARP tables. Or as stated in a comment to the document I inked to earlier:
"However, a PROPER network driver will issue a Gratuitous ARP REPLY every time the interface goes up/down or every time the IP address is changed. This will update all ARP tables in all switches automatically. So no special actions are needed."
03-27-2015 04:47 AM
The arping command is not available on Linux RT, so using that to issue a gratuitous ARP is not possible (?).
It seems I can force things by using "ip link set eth1 down", then "ip link set eth1 up" from an admin session, but I cannot run that using System Exec due to the limited access of the LabVIEW application.
03-30-2015 04:22 AM
Without other suggestions available yet I tried to log on as admin from system exec to be able to run the ip link up/down commands...But if I run "ssh admin@localhost" for example I run into this message:
"Pseudo-terminal will not be allocated because stdin is not a terminal.
Host key verification failed."
I've found some suggestions on Linux sites on how to get passed this, but no luck so far.
03-30-2015 08:36 AM
If you're already on the right device, you don't need ssh. ssh is good for remote access from one device to another. If you just want to change users, the command to consider is "su": http://man7.org/linux/man-pages/man1/su.1.html
03-30-2015 09:05 AM
When changing IP settings, we do an ifconfig down/up. I tried setting a static IP on a 9068 and didn't see an ARP broadcast. However I was able to ping the target on the static IP.
Also arping is available at http://download.ni.com/ni-linux-rt/feeds/2014/arm/armv7a-vfp-neon/iputils-arping_s20101006-r6_armv7a...
You can try add an arping call to /etc/ifplugd/ifplugd.action on the up case, or even run it as a daemon on the target.