Programmatic Interface - Internet Commands

These commands allow control over Internet related functions, such as FTP, NTP, and Ethernet setup.


List of all commands
Programmatic Overview


Show Ethernet

This command returns a complete description of the current Ethernet Setup parameters. When the Ethernet port is using a Static IP setup, then the parameters shown are those that the user has configured. If the Ethernet port is using a DHCP setup, then the values returned will be the configuration values handed out by the DHCP server.

Note that the response is a single-line listing containing numerous parameters. The sample response below is broken into several lines for clarity.


Parameters:

No parameters are available.


Response:
Ethernet ipmode=static ip=192.168.142.174 netmask=255.255.255.0
         gateway=NotSet nameServers=192.168.142.7 
         dnsDomain=NotSet dnsSearch=NotSet mac=00:60:35:00:C3:1A
         mtu=1500

Set Ethernet

This command modifies the Ethernet Setup parameters. The main choice is whether to use DHCP mode or Static mode. If DHCP is specified then most of the other Ethernet parameters will be obtained from a DHCP server on the network. If the user specifies Static mode, then several other parameters can be specified to customize the Ethernet setup.

This command responds with a single line indicating that the setup is about to change. Five seconds later, the changes are put into effect. Since this can change the Ethernet address, Ethernet communications to the NetRS on the old address may stop working. Note that the response does NOT show the changed state of the controls.

For symmetry with the Show Ethernet command, a parameter "mac=" will be accepted but will be ignored.


Parameters:

ipmode=NewMode Either 'static' or 'dhcp' is used to select the new IP configuration mode.
If DHCP mode is selected, then most of the remaining parameters are ignored.
ip=192.168.142.7 The new Ethernet IP address. Must be of the form xxx.xxx.xxx.xxx.
Ignored if DHCP mode is set.
netmask=255.255.255.0 The new Ethernet Netmask value. Must be of the form xxx.xxx.xxx.xxx.
Ignored if DHCP mode is set.
gateway=192.168.142.1 The new Ethernet Gateway value. Must be of the form xxx.xxx.xxx.xxx.
Ignored if DHCP mode is set.
NameServers=192.168.142.1 This is a comma separated list of IP addresses that specify one or more DNS Name Servers. Each of these must be of the form xxx.xxx.xxx.xxx.
Ignored if DHCP mode is set.
DnsDomain=eng.xyz.com This is the default DNS domain in which this NetRS belongs. The full name of the system would be the DnsDomain appended to the SystemName. Thus, If the SystemName was "Sysname" and the DnsDomain was eng.company.com, then the fully qualified name of the NetRS would be "Sysname.eng.company.com".
Ignored if DHCP mode is set.
DnsSearch=xyz.com,eng.xyz.com DnsSearch is the desired DNS search path. This is a comma-separated list of DNS domains which the NetRS will search when trying to expand a partially-qualified System name into a fully-qualified one.
If no search path is desired then 'DnsSearch=NotSet' or 'DnsSearch=' can be used.
Ignored if DHCP mode is set.
MTU=1500 The Maximum Transfer Unit size in bytes. Maximum value is 1500. Minimum value is 600.
This parameter is setable in both Static and DHCP modes.
mac=00:60:35:00:C3:1A The Ethernet hardware's unique low-level address cannot be changed. This parameter is accepted in order to be symetrical with the Show Ethernet command. It will be ignored.

All numeric IP addresses are expressed as four, period-separated, decimal values, like 192.168.142.2. Each value has a range between 0 and 255.


Response:
OK: Installing new ethernet configurations.  Wait five seconds for that
to take effect.

Show FTPSetup

This command returns the current settings of the FTP function. There are three different FTP accounts and they each have an enable control.

The accounts netrsFTP and adminFTP both require a previously created password to have been entered on the system. These passwords are sent as part of the response to Show FtpSetup. The values are sent as encrypted strings, which cannot easily be decrypted back to their original values. The purpose of sending these encrypted values is to allow the same passwords to be re-installed at some later time, or to be transfered to another NetRS system.

In addition to the accounts, the FTP setup information contains the port number that is used by the FTP server. The server listens for connection request on a specific TCP port, which is port 21 by default. This can be adjusted by the user to an alternate port between 1024 and 65535. This value can also be set to disabled to completely disable the FTP server.

Note that response to Show FtpSetup is a single line of text. The sample response sent below is divided into several lines for clarity.


Parameters:

No parameters are available.


Response:
FtpSetup anon=disabled named=disabled admin=disabled
         namedPassword=Ea1kyhBsdj9uk 
         adminPassword=LAj2CgNKpTzPw
         port=21

Set FtpSetup

This command modifies the settings of the FTP function. It allows adjustment of one or more of the parameters. See the description of Show FtpSetup for details on the FTP controls.

One or more of the possible parameters must be specified. When this command is received, the current settings are preserved except for those parameters that are explicitly given. Thus, it is possible to modify only a single setting without affecting the others.

Passwords can be set using either encrypted or unencrypted parameters. Parameters 'adminClearPW' and 'namedClearPW' both accept clear-text passwords, which are encrypted and used inside the NetRS. The alternate parameters, 'namedPassword' and 'adminPassword', accept only encrypted passwords, as produced by command Show FtpSetup. These are designed to allow transfering the encrypted values between systems in a secure manner.

The TCP port on which the FTP server listens for requests can be set to any value between 1024 and 65535 (inclusive), or to the default value of port 21. A value of 21 can also be specified with port=standard. The FTP server can be completely disabled by specifying port=disabled.


Parameters:

anon=enabled Used to control the anonymous FTP mode.
Set to either 'enabled' or 'disabled' or 'enabledWithDelete'.
named=enabledWithDelete Used to control named FTP account (user netrsFTP).
Set to either 'enabled' or 'disabled' or 'enabledWithDelete'.
admin=disabled Used to control the anonymous FTP mode (user adminFTP).
Set to either 'enabled' or 'disabled'.
namedPassword=EncryptedPW Sets the password for the named FTP (user netrsFTP) account to match the encrypted parameter value.
adminPassword=EncryptedPW Sets the password for the admin FTP (user adminFTP) account to match the encrypted parameter value.
namedClearPW=password Sets the password for the named FTP (user netrsFTP) account to match the unencrypted parameter value.
adminClearPW=password Sets the password for the admin FTP (user adminFTP) account to match the unencrypted parameter value.
port=standard
port=8021
port=disabled
Sets the TCP port number to which the FTP server will listen for client requests. Acceptable numeric values are 21 or any number between 1024 and 65535. The port parameter will accept standard as a synonym for 21. The FTP server can be completely disabled by specifying a port value of disabled.


Response:
OK: FtpSetup anon=enabled named=enabledWithDelete admin=disabled
             namedPassword=Ea1kyhBsdj9uk 
             adminPassword=LAj2CgNKpTzPw
             port=8021

Show NtpClient

This command returns the current control settings of the NTP (Network Time Protocol) Client function. The NTP client is used to obtain time from an external server at system startup. Note that once GPS tracking begins, precise time is always available from the satellites.

The response will indicate if the NTP Client function is enabled or disabled. If enabled, then a list of one or more NTP servers is also returned.


Parameters:

No parameters are available.


Response:
NTPclient enable=yes servers=192.168.142.1,ntp.xyz.com

Set NtpClient

Modifies the control settings for the NTP client function. The NTP client is used to obtain time from an external server at system startup. Note that once GPS tracking begins, precise time is always available from the satellites.

The parameters allow you to enable or disable this feature, and to specify up to three external time servers.


Parameters:

enable=yes Can be 'yes' or 'no'. If 'yes', then one or more servers must be specified in the other parameter. If 'no', then no servers can be specified.
servers=192.168.142.1,ntp.xyz.com A comma-separated list of NTP servers. Servers can be specified using numeric IP addresses. If a DNS server has been configured, then DNS-style names can also be used.


Response:
OK: NTPclient enable=yes servers=192.168.142.1,ntp.xyz.com

Show HttpPorts

This command returns the current controls over the HTTP and HTTPS ports. The internal Apache web server accepts connections over one or more ports, using HTTP or HTTPS protocols. The default port numbers for these services are 80 and 443 respectively. An alternate port can be defined for either HTTP or HTTPS or both, and any of these four ports can be enabled or disabled.

The response will indicate which ports will accept HTTP or HTTPS connections.


Parameters:

No parameters are available.


Response:
HttpPorts httpPort80=yes     
          httpAltPort=yes,8080 
          httpsPort443=yes   
          httpsAltPort=no,8443

Set HttpPorts

Modifies the controls for the HTTP and HTTPS ports. The internal Apache web server accepts connections over one or more ports, using HTTP or HTTPS protocols. The default port numbers for these services are 80 and 443 respectively. An alternate port can be defined for either HTTP or HTTPS or both, and any of these four ports can be enabled or disabled.

This command can be used to modify the settings for one or more of the four ports. Any control settings which are not explicitly given in the parameters are left unchanged. Thus, it is possible to modify any subset of the port controls without affecting the others.

This command will be rejected if the result of implementing the command would be to disable all HTTP and HTTPS ports.

The response to a successful invocation of this command will be "OK:" followed by the response generated by the Show HttpPorts command. The response will always show the complete set of HTTP/HTTPS port parameters, regardless of which parameters are included in the original command.


Parameters:

httpPort80=yes Controls the standard HTTP port 80.
Yes enables the internal web server to accept HTTP connections on port 80.
No disables such connections.
httpAltPort=yes,8080
httpAltPort=no
Controls the alternate HTTP port, and specifies the alternate port number.
Yes enables the internal web server to accept HTTP connections on the specified alternate port.
No disables such connections.
httpsPort443=yes Controls the standard HTTPS port 443.
Yes enables the internal web server to accept HTTPS connections on port 443.
No disables such connections.
httpsAltPort=yes,8443
httpsAltPort=no
Controls the alternate HTTP port, and specifies the alternate port number.
Yes enables the internal web server to accept HTTP connections on the specified alternate port.
No disables such connections.


Response:
OK: HttpPorts httpPort80=yes     
              httpAltPort=yes,8080 
              httpsPort443=yes   
              httpsAltPort=no,8443

Show IpFiltering

This command returns the current control settings of the IP Filtering system. IP Filtering is a method of restricting connections from external client systems based on the IP addresses of the clients. When this function is enabled (enable=yes) IP messages will only be accepted from specific IP addresses or IP address ranges. Multiple addresses or address ranges can be defined. IP packets will be ignored by the NetRS if they come from clients whose IP addresses are outside the specified ranges.

When IP Filtering is disabled (enable=no) then all IP packets will be accepted and processed by the NetRS, regardless of their source IP address.

The response to Show IpFiltering shows the currently accepted IP address ranges. These are specified by a base address and a bitcount. The base address represents one specific address somewhere in the range, as a 32 bit value, separated into four bytes. For example, 10.1.142.17. Bitcount defines the size of the address range, by specifying how many bits of the base address are used when testing a client address for inclusion in the range. For example:

155.63.21.25/32 Range includes only a single address. All 32 bits of the client address must match.
155.63.21.25 Same as 155.63.21.25/32
155.63.21.25/24 The 24 most significant bits of the client address will be compared to the matching bits of the base address. This defines a range of 256 addresses from 155.63.21.0 through 155.63.21.255. Note that the base address does not have to be at the start of the range.
155.63.21.25/16 The 16 most significant bits of the client address will be compared to the matching bits of the base address. This defines a range of 65536 addresses from 155.63.0.0 through 155.63.255.255.

Multiple address ranges of different sizes can be defined for Ip Filtering. Packets from a client will be accepted if the client IP matches any of the specified ranges.


Parameters:

No parameters are available.


Response:
IpFiltering enable=yes 
            range1=192.168.142.1/32 
            range2=192.168.142.7/32 
            range3=192.168.143.0/24
            ...

Set IpFiltering

Modifies the controls for the IP Filtering system. See the description under Show IpFiltering for details.

The response to a successful invocation of this command will be "OK:" followed by the response generated by the Show IpFiltering command. This always shows the updated state of the controls.

Multiple range parameters can be supplied with this command. The parameter names for these can be either range= or rangeN=, where N is any integer. The numeric suffixes are essentially arbitrary, as is the order in which they are placed in the command. Thus, you could specify three separate ranges and they all could all use "range=" with no suffixes. Or you could specify range1=, range5=, and range2=. The OK: response to this command will always specify the ranges as range1, range2, range3, etc.

This command can only be used to specify the COMPLETE state of the IP Filtering controls. It is not possible to add or delete individual address ranges from the current settings.

WARNING

Improper setting of the IP Filtering controls can result in inability to communicate with the NetRS system. Be certain that at least one valid address range is defined. It would be wise to include the address from which you are transmitting this command or communication of other commands will become impossible.


Parameters:

enable=yes Controls whether IP Filtering will occur.
Yes: IP connections will be restricted to clients located in the address ranges listed in the range parameters.
No: IP Filtering will NOT be done. Connections can be made from clients at any IP address.
range=192.168.142.1
range0=192.168.142.7/32
range1=192.168.143.0/24
Defines a range of IP addresses from which connections will be allowed. See Show IpFiltering for a description and examples of the address range formatting.


Response:
OK: IpFiltering enable=yes 
                range1=192.168.142.1/32 
                range2=192.168.142.7/32 
                range3=192.168.143.0/24
                ...