Like all things Linux, when it comes to assigning a static IP address to your Raspeberry Pi, there are hundreds of blog posts documenting dozens of ways… and none of them seem to work. These all contain plenty of jargon for the Linux initiated but seem to be short on actual answers for guys that spend all day on Windows and just want a quick fix.
1. Get your Pi up and running and connected to the network.
2. SSH into your Pi. Don’t know what that is? No big deal! Download PuTTY (zip or installer version) and run it.
3. You’ll be greeted with a screen like this.
The default user name is “pi” and the password is “raspberry”
4. Find out your current network information by typing “sudo ifconfig”.*
Make a note of what this address is and your network connection name (wlan0 for my wireless connection eth0 if it was plugged in) are as we will be using them later.
You’ll also need your router’s address which you can find by (you guessed it) another command called route. Type in “sudo route –n”
5. Armed with this information, you need to edit a config file. Enter “sudo nano /etc/dhcpcd.conf”
This will be an odd experience if you haven’t done much with Linux.
Yes. An editor that looks like it’s from 1992. It’s lightweight and does the job across a network connection though.
You’re a hacker now.
6. Scroll all the way down to the bottom and add the lines that are highlighted above, replace the information from above to match what I have.
I haven’t truly embraced the Linux ethos yet, so instead of skippng over the obvious question because I’m an asshole, I’ll go ahead and tell you what that 22.214.171.124 is: Google’s DNS servers.
7. You’d probably like to save this. Hit “ctrl + O”, and then “enter” to accept the file name. Then hit “ctrl + x” to quit.
8. sudo reboot
9. When your Pi comes back up, you should be able to connect to it again via PuTTY using the IP address you just entered.
*“sudo” stands for “super-user do”, which makes you feel like you’re kicking ass instead of screaming at a borderline awful way of configuring a computer.