How to set static IP from root access from terminal for Ender v3 KE

Hi there,
I just got my Ender v3 KE. I connect to it via WIFI but it randomly changes IP address between shutdowns. My router does not support assigning IP addresses based on mac addresses. So I guess only option left is using terminal. But I don’t know which commands work and where to save those commands in order to make it permanent.

Thanks in advance