All of these "tutorials" are obsolete. (Note they can still be used if you want to use the older style of manual configuration, but this requires detailed knowledge.)
If you are running a recent Raspbian /etc/network/interfaces should be as below. If you have changed it PUT IT BACK.
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet manual
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
auto wlan1
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Edit /etc/dhcpcd.conf
as follows (extract from man dhcpcd.conf
):-
Configures a static value. If you set ip_address then dhcpcd will not attempt to obtain a lease
and just use the value for the address with an infinite lease time.
Here is an example which configures a static address, routes and dns.
interface eth0
static ip_address=192.168.0.10/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
PS I still think setting up a static address is almost always the wrong thing to do. If possible set a static reservation in your router (if possible) or use a zero-conf
such as avahi