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 as explained in Remote Access and file transfer.
-
go open the interfaces file.
sudo nano /etc/network/interfaces
-
in the file find this selection of text.
# 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 thegateway
to the desired values. Or switch the interface to DHCP if you connect the controller to a router:# Wired or wireless interfaces auto eth0 iface eth0 inet dhcp
-
Save the file and exit.
If you want to modify the system’s hostname you can change it by modifying
sudo nano /etc/hostname
or
sudo nano /etc/hosts
-
Restart the network to apply the new settings.
sudo /etc/init.d/networking restart
Note
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.