salt.modules.nilrt_ip

The networking module for NI Linux Real-Time distro

salt.modules.nilrt_ip.apply_network_settings(**settings)

Apply global network configuration.

CLI Example:

salt '*' ip.apply_network_settings
salt.modules.nilrt_ip.build_interface(iface, iface_type, enabled, **settings)

Build an interface script for a network interface.

CLI Example:

salt '*' ip.build_interface eth0 eth <settings>
salt.modules.nilrt_ip.build_network_settings(**settings)

Build the global network script.

CLI Example:

salt '*' ip.build_network_settings <settings>
salt.modules.nilrt_ip.disable(interface)

Disable the specified interface

Change adapter mode to Disabled. If previous adapter mode was EtherCAT, the target will need reboot.

Parameters:

interface (str) -- interface label

Returns:

True if the service was disabled, otherwise an exception will be thrown.

Return type:

bool

CLI Example:

salt '*' ip.disable interface-label
salt.modules.nilrt_ip.down(interface, iface_type=None)

Disable the specified interface

Change adapter mode to Disabled. If previous adapter mode was EtherCAT, the target will need reboot.

Parameters:

interface (str) -- interface label

Returns:

True if the service was disabled, otherwise an exception will be thrown.

Return type:

bool

CLI Example:

salt '*' ip.down interface-label
salt.modules.nilrt_ip.enable(interface)

Enable the specified interface

Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot.

Parameters:

interface (str) -- interface label

Returns:

True if the service was enabled, otherwise an exception will be thrown.

Return type:

bool

CLI Example:

salt '*' ip.enable interface-label
salt.modules.nilrt_ip.get_interface(iface)

Returns details about given interface.

CLI Example:

salt '*' ip.get_interface eth0
salt.modules.nilrt_ip.get_interfaces_details()

Get details about all the interfaces on the minion

Returns:

information about all interfaces omitting loopback

Return type:

dictionary

CLI Example:

salt '*' ip.get_interfaces_details
salt.modules.nilrt_ip.get_network_settings()

Return the contents of the global network script.

CLI Example:

salt '*' ip.get_network_settings
salt.modules.nilrt_ip.set_dhcp_linklocal_all(interface)

Configure specified adapter to use DHCP with linklocal fallback

Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot.

Parameters:

interface (str) -- interface label

Returns:

True if the settings were applied, otherwise an exception will be thrown.

Return type:

bool

CLI Example:

salt '*' ip.set_dhcp_linklocal_all interface-label
salt.modules.nilrt_ip.set_dhcp_only_all(interface)

Configure specified adapter to use DHCP only

Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot.

Parameters:

interface (str) -- interface label

Returns:

True if the settings were applied, otherwise an exception will be thrown.

Return type:

bool

CLI Example:

salt '*' ip.dhcp_only_all interface-label
salt.modules.nilrt_ip.set_ethercat(interface, master_id)

Configure specified adapter to use EtherCAT adapter mode. If successful, the target will need reboot if it doesn't already use EtherCAT adapter mode, otherwise will return true.

Parameters:
  • interface -- interface label

  • master_id -- EtherCAT Master ID

Returns:

True if the settings were applied, otherwise an exception will be thrown.

CLI Example:

salt '*' ip.set_ethercat interface-label master-id
salt.modules.nilrt_ip.set_linklocal_only_all(interface)

Configure specified adapter to use linklocal only

Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot.

Parameters:

interface (str) -- interface label

Returns:

True if the settings were applied, otherwise an exception will be thrown.

Return type:

bool

CLI Example:

salt '*' ip.linklocal_only_all interface-label
salt.modules.nilrt_ip.set_static_all(interface, address, netmask, gateway, nameservers=None)

Configure specified adapter to use ipv4 manual settings

Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot.

Parameters:
  • interface (str) -- interface label

  • address (str) -- ipv4 address

  • netmask (str) -- ipv4 netmask

  • gateway (str) -- ipv4 gateway

  • nameservers (str) -- list of nameservers servers separated by spaces (Optional)

Returns:

True if the settings were applied, otherwise an exception will be thrown.

Return type:

bool

CLI Example:

salt '*' ip.set_static_all interface-label address netmask gateway nameservers
salt.modules.nilrt_ip.up(interface, iface_type=None)

Enable the specified interface

Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot.

Parameters:

interface (str) -- interface label

Returns:

True if the service was enabled, otherwise an exception will be thrown.

Return type:

bool

CLI Example:

salt '*' ip.up interface-label