I was looking into setting up my Raspberry Pi 2 to be available as a VPN for when I'm away from home, and as I was going through tutorials I found that my Raspberry Pi would need to be on a static IP so that it can always be found in the same location.

Many tutorials went through a lot of different in-depth steps to set this up, such as this ReadWrite one. I came across a much easier method!

Step 1

First, you still need to find out what DHCP ports your router is using (these are the ports that are assigned to new devices when they connect to the network). Your Raspberry Pi will be on an IP outside of that range, so that a new device never gets assigned it.

When I logged into my router settings, I found that my router assigns IPs in the range 192.168.1.100 to 192.168.1.255, so I decided that my Raspberry Pi will live on 192.168.1.50.

Step 2

Next, I boot your Pi into Raspbian OS, and right-click on the connection button on the top right (would look like a WiFi symbol if you're on WiFi, or a cable on ethernet), and click on "WiFi Networks (dhcpcdui) Settings".

This will bring up a new window that says 'Configure: interface' by default. Click on the drop-down to right of that and select 'eth0' to configure ethernet connections, or 'wlan0' for WiFi.

In the IP Address field, put in your chosen IP (remembering it has to be one outside of the DHCP range). Click Apply.

Step 3

Next, restart your Raspberry Pi and it should be available on the chosen IP forever! Congratulations.

Thanks for reading!



Check out my other blog posts! If you found this post interesting, feel free to let me know either on Twitter (@Isaac_M_Jordan), or in the comments section below.

Enjoyed my post? Sign up to the newsletter to receive a small email when I post. No spam, I promise.