Enterprise Linux 9 / Raspberry Pi OS 12 :
sudo nmtui
Or
su
# list devices (ens192 used as example below)
nmcli device
# set [manual] for static setting or [auto] for DHCP
nmcli connection modify ens192 ipv4.method manual
nmcli connection modify ens192 ipv4.addresses xx.xx.xx.xx/24
nmcli connection modify ens192 ipv4.gateway xx.xx.xx.1
# for multiple DNS, specify with space separated
nmcli connection modify ens192 ipv4.dns "xx.xx.xx.1 xx.xx.xx.2"
# restart the interface to reload settings
nmcli connection down ens192; nmcli connection up ens192
# confirm the applied settings
nmcli device show ens192
# confirm state
ip address show
Debian 12 :
su
ip a
nano /etc/network/interfaces
# restart the interface to reload settings
systemctl restart networking
# confirm state
systemctl status networking
Raspbian 10 / Raspberry Pi OS 11 :
sudo nano /etc/dhcpcd.conf