How to setup static IP addresses

From Stackexchange:

When to use which file?
I’m going to make the assumption that you are suffering from a general degree of confusion that is occurring at the moment (in the wider Raspberry Pi community) with the introduction of Debian ‘Jessie’ in place of Debian ‘Wheezy’. This change has made a large number of tutorials at worst obsolete and at best confusing.

Does dhcpcd has somehow priority over /etc/network/interface?
No, they’re different and are designed to suit different purposes under Jessie. For the purposes of using Jessie in a fairly simple way you can pretty much ignore the interfaces file and work with dhcpcd.conf and wpa_supplicant.conf.

How to check which service has priority or someting? And which service uses /etc/network/interface?
Again I’m going to make the assumption that the question is more of a ‘Which file do I use and if I have to use one which takes priority?’ question. The answer is that with the change from Wheezy to Jessie (and in a broader sense with the adoption of systemd) the configuration of `dhcpcd.conf’ and ‘wpa_supplicant.conf’ will be the norm and the ‘interfaces’ file will be left to it’s own devices.

What does this mean for you?

Well (again) making an assumption that you’re trying to set up a hard wired (eth0) and wireless (wlan0) connections with static IP addresses, you would want your interfaces file to be the default as it was initially installed;

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

You would want your dhcpcd.conf file to include the connection details at the end of the file for both interfaces and the additional entries would probably look a bit like this;

# Custom static IP address for eth0.
interface eth0
static ip_address=
static routers=
static domain_name_servers=

# Custom static IP address for wlan0.
interface wlan0
static ip_address=
static routers=
static domain_name_servers=
Lastly you would want to edit your wpa_supplicant.conf file so that it includes the ssid for the wifi network and the password. It should probably look a bit like this;

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev