How to stop Static IP being overridden by DHCP?

I need assistance figuring out why DHCP is reverting my static IP assignment to intf eno1 on Ubuntu MATE.

I have modified the /etc/netplan/config.yaml to reflect the desired static IP (config below) and also commented out all of the configuration lines in the dhcpcd.conf.

At /etc/netplan/ if I run sudo netplan apply, it will revert the DHCP learned address to the static IP until the next lease renewal.

Does anyone know how to stop DHCP from reverting the static IP assignment to eno1?

network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: no
addresses:
- 192.168.10.22/24
gateway4: 192.168.10.1
nameservers:
addresses:

Linux version 5.4.0-54-generic (buildd@lcy01-amd64-024) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #60-Ubuntu SMP

Hi @yowtf,

Did you try to configure the static IP over Network Manager ?

This should fix your IP.

you can also do it over cli with nmcli :

nmcli help 
Usage: nmcli [OPTIONS] OBJECT { COMMAND | help }

OPTIONS
  -t[erse]                                       terse output
  -p[retty]                                      pretty output
  -m[ode] tabular|multiline                      output mode
  -c[olors] auto|yes|no                          whether to use colors in output
  -f[ields] <field1,field2,...>|all|common       specify fields to output
  -g[et-values] <field1,field2,...>|all|common   shortcut for -m tabular -t -f
  -e[scape] yes|no                               escape columns separators in values
  -a[sk]                                         ask for missing parameters
  -s[how-secrets]                                allow displaying passwords
  -w[ait] <seconds>                              set timeout waiting for finishing operations
  -v[ersion]                                     show program version
  -h[elp]                                        print this help

OBJECT
  g[eneral]       NetworkManager's general status and operations
  n[etworking]    overall networking control
  r[adio]         NetworkManager radio switches
  c[onnection]    NetworkManager's connections
  d[evice]        devices managed by NetworkManager
  a[gent]         NetworkManager secret agent or polkit agent
  m[onitor]       monitor NetworkManager changes 

Good luck and do not hesitate to ask for help :slight_smile: