Using Raspian, howto set a static IP Address on the Raspberry Pi 2.
cat /etc/network/interfaces
auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
To set the Pi to a static IP address, you need to know the following:
address
netmask
network
broadcast
gateway
Now you edit /etc/network/interfaces
and replace iface eth0 inet dhcp
with iface eth0 inet static
and add the information as above. Example below, replace with information to suit the network settings for your Pi.
sudo nano /etc/network/interfaces
pi@pi2 ~ $ cat /etc/network/interfaces auto lo iface lo inet loopback iface eth0 inet static address 192.168.0.XXX netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.1 allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
Now reboot
sudo reboot
Results in a static ip address but NO internet connection so its useless.
LikeLike