[SOLVED]Setting IP static

It seems OSMC uses connman, so in order to create an ethernet static IP:

  1. Create a config file with your editor:

    sudo vim /var/lib/connman/osmc.config
    
  2. 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 and Nameservers to use the ones you want.

  3. Reboot your RPi or restart the connman service:

    sudo systemctl restart connman
    

If you opt to restart connman, you’ll loose the connection.


Sources:

1 Like