Unable to set static address

I have installed ubuntu server and installed LXDE.
LXDE use NetworkManager to manager network interface.
I tried configuring static ip address in /etc/network/interfaces
But after boot IP is not assigned.

what’s the content of /etc/network/interfaces?

content of /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.125
netmask 255.255.255.0
gateway 192.168.1.1

Also in /etc/NetworkManager/NetworkManager.conf
is have following lines

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

[keyfile]
unmanaged-devices=interface-name:eth0

Also output of command nmcli dev status

DEVICE  TYPE      STATE         CONNECTION
eth0    ethernet  connected     Wired connection 1
wlan0   wifi      disconnected  --
lo      loopback  unmanaged     --

If its bionic it now uses yaml for networking and its not radxa its your doing it the old and wrong way.
Had to google as had forgot the name “Netplan”

I was the same with bionic as spent ages battling with /etc/networking until surprised with a wtf is netplan!
Netplan makes complex networking much easier but actually for simple networking is quite confusing at first as the config for networking is now /etc/netplan/

I don’t know how it started working after I installed netplug package.

While installing this package it installed ifupdown package and it started picking up address from /etc/network/interfaces

1 Like

Yeah not sure how that will work as now it prob has both network services just not defined in Netplan.
You don’t edit /etc/network in ubuntu anymore at least with bionic LTS dunno about later.
They are all yaml’s with numeral prefixes in /etc/netplan prob better having a read of netplan as you got it working but its not how Ubuntu “intended” anymore
https://netplan.io/
/etc/network is still there but is legacy as netplan replaces it