NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Ip-address

Hi,

I was wondering if there was a way to change the ip-address of a NI linux RT system, using SSH or perhaps changing a config file via Ftp(or any other standard methode)?

I hope to avoid the need for MAX since i understand that one needs real time module and similar innstalled on the computer doing the ip configuration via MAX.


Regards

Mrmas

0 Kudos
Message 1 of 10
(6,721 Views)
Message 2 of 10
(6,339 Views)

I don't have my LV RT system in front of me, but if it is like Ubuntu or CentOS, there should be a file /etc/network/interfaces which contains the information on the IP address.  There may be some other files that are read in by this, but look for the eth0 entry and adjust accordingly.  If it is like other flavor of Linux, you should be able to restart the networking module using

sudo  /etc/init.d/networking restart

But, this is all predicated on whether this distro is similar to more popular distrubutions (which it may not be).

Cheers, cirrus

0 Kudos
Message 3 of 10
(6,339 Views)

If I remember correctly (I also don't have a target with me to test) chaging the IP address in MAX or through the web interface does more than just change the IP address on the target. It also updates other configuration files that the labview run-time and other NI drivers rely on.

So, you can likely find a way to change the address for your interface (ifconfig, config file change) but it may disrupt an NI service/runtime/driver. I believe that's the main reason why its recommended to use MAX or the web interface to make this change.

Tim A.
0 Kudos
Message 4 of 10
(6,339 Views)

cirrusio wrote:

I don't have my LV RT system in front of me, but if it is like Ubuntu or CentOS, there should be a file /etc/network/interfaces which contains the information on the IP address.  There may be some other files that are read in by this, but look for the eth0 entry and adjust accordingly.  If it is like other flavor of Linux, you should be able to restart the networking module using

sudo  /etc/init.d/networking restart

But, this is all predicated on whether this distro is similar to more popular distrubutions (which it may not be).



Cheers, cirrus


Sadly, the filesystem leads you to believe that this is the appropriate approach (the interfaces file as well as if(up|down) trigger script folders exist) however this system is not used and has not been removed from the image (there is an internal issue tracker item to clarify this).

Mrmas,

Back to your original question: do you need the change to be persistent or temporary?

0 Kudos
Message 5 of 10
(6,339 Views)

I needed the change to be persistent, and I am happy to say it seems like the webinterface works. I have not tried this on more than my own development computer yet though so it could be because of something i have installed, but as i understand the webinterface only needs silverlight installed to run?  If so i think that solves my problem. Thank you very much.

I would however be interested to know of other methodes, and as you mention BradM the web solution i guess is persistent and i would also like to know a methode for a temporary change which i could need later.

Regards

0 Kudos
Message 6 of 10
(6,339 Views)

Mrmas,

Using traditional linux-y commands for adjusting networking configurations will be temporary. Additionally, the web interface will interact with a lower-level tool for managing the NI-specific management of network configuration (as well as other system configuration facets).

NOTE: This is not a supported interface! It can and may change at some future release!

The nirtcfg tool can be used to view or modify the system configuration without the need to use the web interface.

0 Kudos
Message 7 of 10
(6,339 Views)

Now that we for some reason no longer have a proper web interface to make such changes in a user friendly and safe(r) way without special software I found this thread, and a page that describes the use of nirtcfg, promisingly named: 

Changing NI Linux RT OS Network Settings Using Command Prompt

The page describes how to set the gateway, subnet mask, turn on DHCP etc, but for some reason fails to describe how to set the actual (static) IP-address:

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000xDY9CAM&l=en-NO

 

So here is an example of that command:

nirtcfg --set section=ETH0,token=ip_address,value=192.168.1.5
/etc/init.d/networking restart

 

Message 8 of 10
(812 Views)

would it be possible to create -with LabVIEW - an EXE similar to the RAD Utility that would send the command via SSH to the target?


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 9 of 10
(769 Views)

You can use the system configuration API instead if you are going to make and install a custom application. Or install NI Max. Both can be a big hassle to get to a customer and get installed and understood though compared to just browsing to the given IP with a regular web browser. The old silverlight-based solution was OK as long as Silverlight was common or easy to get, but needed to be replaced now. Unfortunately it has just been replaced with a non-functional page looking like something made in the late 90s...

0 Kudos
Message 10 of 10
(763 Views)