It seems OSMC uses connman, so in order to create an ethernet static IP:
-
Create a config file with your editor:
sudo vim /var/lib/connman/osmc.config
-
Add the following contents:
[global] Name = OSMC Description = OSMC static network configuration [service_osmc] Type = ethernet IPv4 = 192.168.0.21/255.255.255.0/192.168.0.1 Nameservers = 8.8.8.8,8.8.4.4
Make sure to change the
IPv4
line to match your own network/netmask/gateway andNameservers
to use the ones you want. -
Reboot your RPi or restart the connman service:
sudo systemctl restart connman
If you opt to restart connman, you’ll loose the connection.
Sources: