Introduction
Would you like to change the static IP from your Raspberry Pi PLC controller?
Follow the steps on this post to find out how to do so with industrial automation!
Remember that if you change the static IP from your Raspberry Pi industrial PLC, you will need to use that IP later on if you want to connect again with the Raspberry and not with the default one!
How to change a static IP with Raspberry PLC
First, we need to access the industrial Raspberry Pi PLC. There are 2 different ways.
1. Connect an external keyboard to one of the USB ports of the Raspberry PLC and an external screen to one of the free HDMI ports.
2. By SSH: To do so, you need to change the IP from your PC to be on the same network as the Raspberry PLC IP, but it is important not to have the same IP.
After doing this, you are now ready to connect with the Raspberry PLC. Connect the Ethernet cable from your PC to the Raspberry PLC Ethernet port 0, open a terminal, and type:
$ ssh [email protected]
If done right, a password will be required (default password: raspberry). After that, you will be in the Raspberry PLC.
The next step is: how to change the static IP. Follow the steps of example static IP.
To see the IP address from the Raspberry PLC, type:
$ ip a
Then, look for eth0 or eth1, depending on which of them you are willing to change. In the example, we have changed eth0.
Here it appears the address 10.10.10.20.
Now you need to modify the dhcpcd.conf file, located in /etc/ folder. Install nano if you do not have it:
$ sudo apt-get install nano
$ sudo nano /etc/dhcpcd.conf
In this file, you will need to find the commented paragraph that looks like this:
Uncomment all these lines and change the ip_address to your new ip_address. It is important to change the routers variable too to the same IP as the ip_address, but ending in 1, like in this example:
In the example, the new ip_address will be 10.10.10.19. Save the file and exit.
It is very important to remember the new IP because the default one does not work anymore and if you forget it you will not be able to enter the Raspberry PLC again. To change the eth1 IP address, just change the number that appears in the second line: eth0 --> eth1.
One more step is needed before changing the static IP. Type in the terminal:
$ sudo nano /etc/network/interfaces.d/eth0_1
or
$ sudo nano /etc/network/interfaces.d/eth1_1
Next, comment all lines in the file like this:
After the change, exit the file and save it. Then, close the Raspberry PLC by typing:
$ exit
Also, disconnect it from the power supply. You may need to wait a bit to let the Raspberry PLC close properly.
Finally, connect again to the Raspberry PLC by typing:
$ ssh pi@"your new static ip"
In case this message appears, just type “yes”.
If everything has been done correctly, you have changed the IP from your Raspberry PLC. To check everything went right, type:
$ ip a
You will see that eth0 / eth1 has now the new IP and the old one does not appear anymore.
You have successfully changed the static IP from a Raspberry PLC!

How to configure a static IP with industrial Raspberry Pi automation