Network settings

2 minute read

This chapter will explain how to change the IP address of your controller.

Network adapter configuration

First log in to the controller. Either by connecting a keyboard and screen to the controller or logging in through ssh:

ssh admin@192.168.2.100

Then if you want to reconfigure the controller’s network settings, like changing its IP address do the following.

sudo nano /etc/network/interfaces

Look for the following section in this file:

# Wired or wireless interfaces
auto eth0
iface eth0 inet static
    address 192.168.2.100
    netmask 255.255.255.0
    gateway 192.168.2.100

Change the address and the gateway to the desired values. Save the file and exit.

If you want to modify the system’s hostname you can change it by modyfying /etc/hostname and /etc/hosts.

Restart the network to apply the new settings.

sudo /etc/init.d/networking restart

If you changed IP address while connected to the terminal over the network, your connection will probably be lost after restarting the network.

It is possible that due to the network change the communication certificate has become invalid. For security reasons, the certificate is only valid for the ip address and hostname of the controller. MCX-Linux OS provides a certificate renewal service that checks the certificate and renews it if either it has expired or if the host name or ip address has changed. To renew the certificate, either reboot the controller or restart the cert-gen service:

sudo /etc/init.d/cert-gen restart

Optionally, you can modify the certificate settings by modifying the cert-gen config file:

sudo nano /usr/share/cert-gen/config.json

After your modification restart the service to generate the new certificate.

EtherCAT adapter config

The EtherCAT master needs to know which card it will use for EtherCAT. The EtherCAT network card should not be configured for normal networking.

To change the EtherCAT network settings do:

sudo nano /etc/ethercat.conf

The important settings in this file are which network adapter to use and which driver to use.

You can select your network adapter by modifying the following line:

MASTER0_DEVICE="eth1"

To select the driver type, change the line:

DEVICE_MODULES="generic"

Refer to the EtherLAB documentation for a description of all available configuration options.

Last modified April 5, 2021: Updated network config (d231459)