Home

Documentation

Project Support

ifconfig

Command:ifconfig
Contexts:Network socket, serial console.
Function:Displays or sets the STARGRASP controller's network configuration
Required Parameters:none.
Optional Parameters:dynamic
static ipaddress netmask logaddress defaultrouter

With no parameters, this command displays the current configuration and basic stats of the STARGRASP controller's network interface. This includes the link status, MAC address, configuration (dynamic or static), IP address information and packet counts. For example:

Link: up                                                                         
HWaddr 00:50:C2:64:90:5A                                                         
IP address configuration: Dynamic                                                
inet addr: 10.213.1.170  Mask:255.255.0.0  Router:10.213.1.1                     
RX packets:2244219                                                               
TX packets:323158 errors:0

Additionally, the ifconfig command can be used to choose between two methods of obtaining an IP address: dynamic, which obtains an IP address and other information via DHCP; or static which assigns a specific IP address to the controller.

Dynamic IP

When set, the STARGRASP controller will negotiate an IP address via DHCP with a server on the network. In this mode, it takes the IP address, netmask and gateway IP assigned by the DHCP server, and will send log messages to the address specified by the configured next-server parameter (see the DHCP server's documentation for how to set this).

Usage:

ifconfig dynamic

Static IP

In this mode, the STARGRASP controller uses a preconfigured IP address to communicate on the network.

Usage:

ifconfig static ipaddress netmask logaddress defaultrouter

The four required parameters after the static option are as follows:

  • ipaddress - the IP address that the system should use.
  • netmask - the netmask for the subnet the system is on.
  • logaddress - the IP address where the system should log to.
  • defaultrouter - the gateway for the network the system is connected to.

All four parameters must be supplied in dotted-decimal format.

Notes:

Due to space constraints, the ability to change the IP address mode is only available from the loaded "stage2". "stage1" will make use of the configured mode, but the additional code to change the mode is only part of "stage2".

When switching between dynamic and static mode, the controller must be rebooted for the change to take effect.