Static IP Address
It is sometimes desirable to provide static IP configuration for network interface instead of relying on DHCP.
Using /etc/network/interfaces
Edit /etc/network/interfaces and add configuration sections for network interfaces. The example below configures eth0
auto eth0 iface eth0 inet static address 192.0.2.7 netmask 255.255.255.0 gateway 192.0.2.254
Configure connman interface blacklist
The default Yocto network manager is connman. It is a service to manage network connections in embedded devices. Connman may override the settings in /etc/network/interfaces unless configured to blacklist certain interfaces. For example, after configuring eth0 and eth1 in /etc/network/interfaces, create /etc/connman/main.conf and add the following:
[General] NetworkInterfaceBlacklist=eth0,eth1
Configure static IP using connman
Instead of using /etc/network/interfaces one can use connman command line interface to configure static IP.