Changing NI Linux RT OS Network Settings Using Command Prompt

Updated Jul 28, 2023

Reported In

Hardware

  • PXI Controller
  • CompactRIO Controller

Operating System

  • LabVIEW Real-Time (NI Linux Real-Time)

Issue Details

  • How can I change the network settings on the NI Linux RT OS from Static to DHCP using the command prompt?
  • How can I use the command prompt to modify the NI Linux RT OS network settings for Subnet mask, Gateway, and DNS?

Solution

You can use the command below to change the network settings from Static to DHCP as shown below.
nirtcfg --set section=ETH1,token=dhcpenabled,value=1

LInux.png

You can use the command below to change the network settings for Subnet mask, Gateway and DNS:
  • Subnet mask: nirtcfg --set section=ETH1,token=Subnet_Mask,value=255.255.255.0
  • Gateway: nirtcfg --set section=ETH1,token=Gateway,value=10.161.81.1
  • DNS: nirtcfg --set section=ETH1,token=DNS_Address,value=10.161.81.1
Note: It is compulsory to restart the network after modifying to make sure the network settings are properly configured. You can restart it by using the following command: /etc/init.d/networking restart