With a static IP, you’ll be able to use the same IP address every time you connect to your Pi via SSH.
Before starting, make sure you have already set up and configured a way to access the command prompt. Check out my tutorial, Raspberry pi Raspbian Jessie Lite headless wifi setup tutorial to see how to do that if you haven’t already. Lets begin.
- Log in to your Pi (ssh/terminal) and execute command:
Here you can see that my current pi ip address is 192.168.8.106
- Now run:
sudo nano /etc/dhcpcd.conf
and add at the end of the file (my example):
interface wlan0 static ip_address=192.168.8.115/24 static routers=192.168.8.1 static domain_name_servers=192.168.8.1
So ip_address is the ip you wish to be your static ip and routers and dns servers are your router ip-s. Usually the routers ip ends with 1 unless you haven’t configured your router differenltly.
- Reboot and connect to the new ip address.
*Tutorial on Linux version 4.4.50/ Raspbian v. 8 (jessie)