DHCP hijacks static IP and route in /etc/sysconfig/network

Hi, I have leap 15.3., I’ve been on dhcp, but now I want to switch to static IP only. So I did this:

me@opensuse:~> cat /etc/sysconfig/network/ifcfg-eth0
me@opensuse:~> cat /etc/sysconfig/network/routes
default - -

Before editing resolv.conf, I have replaced NETCONFIG_DNS_POLICY=“auto” with “” in /etc/sysconfig/network/config like this:
and placed in resolv.conf

me@opensuse:~> cat /etc/resolv.conf

Nonetheless IP and route settings in config files have no effect, everything is still replaced by dhcp. Settings I wrote into /etc/resolv.conf vaporised everytime I reboot, but I managed to resolve it by rm /etc/resolv.conf and creating it again, because it was a symlink to /run. I’m using NetworkManager instead of wicked, so I cannot edit network via yast, but even if I could, I’d like to manage that myself :wink: My interface is really eth0, not that enpwhatever.

Thank you.

Why didn’t you use the YaST module for this. There one of the items is to choose if you want to use DHCP and you can configure all the rest also there.

Which never used configuration files in /etc/sysconfig/network so your changes there are irrelevant.

I’d like to manage that myself

Use NetworkManager GUI provided by your desktop environment, use nmtui or nmcli or edit NetworkManager connection definitions directly. It is up to you. But you have to use tools and configuration files suitable for the program that manages your network.

Thank you, nmtui worked, I have no DE installed, only openbox. I’m using networkmanager, because it is on other distros too, and during install I can choose to use either wicked, or networkmanager. If I could, I’d not use any of them, but I don’t know how :shame:

Because yast is addictive, not available on other systems and I don’t want to get addicted :wink: