This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to set static ip for EVMK2H12 board correctly?

I want to set static ip for EVM Linux system. But I failed doing this by many ways.

Firstly I set eth0 interface in "/etc/network/interfaces" like this:

# Wired or wireless interfaces
auto eth0                     
iface eth0 inet static        
        address 192.168.0.211
        netmask 255.255.255.0
        gateway 192.168.0.1   
        dns-nameservers 192.168.1.1
        
Then I insert dns server ip addr "192.168.1.1" into "/run/systemd/resolve/resolv.conf" (link with "/etc/resolv.conf"), after reboot, I find the file is changed like this:

k2hk-evm:/home/mcw# more /run/systemd/resolve/resolv.conf
# This file is managed by systemd-resolved(8). Do not edit.
#
# Third party programs must not access this file directly, but
# only through the symlink at /etc/resolv.conf. To manage
# resolv.conf(5) in a different way, replace the symlink by a
# static file or a different symlink.

nameserver 172.168.168.1
nameserver 192.168.1.1

"nameserver 172.168.168.1" became the first dns server. But what I need to set is "192.168.1.1".

When I execute "/etc/init.d/networking restart", the static ip addr is updated into 192.168.0.211 as I set in "/etc/network/interfaces".

However every time I reboot the EVM, the etho0 ip addr is still the wrong one instead of my setting.

I also tried set ip addr in u-boot, but it seems not be the correct place to set and the issue is still there.

Does anyone know how to set this ip addr as setting value?

Thanks so much!!