Raspberry Pi Static IP

Raspbian Jessie uses a different network manager than most other Linux systems and previous versions of Raspbian. Most users will have no use for a static IP, but it is necessary in some environments. There is a lot of confusion online, but this method has been tested to work with the newest edition of Raspbian as of August 8th, 2016.
Also please note, depending on what you need a static IP for, it may be easier to go into your router(or other DHCP server) and specify an IP for your device there.

First, open /etc/dhcpcd.conf with your favorite text editor(We'll use nano).
Run the command: sudo nano /etc/dhcpcd.conf

Add this to the end:

interface eth0
static ip_address=192.168.1.7/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8



Use Ctrl+X to save and exit

Replace ip_address with an IP of your choice, routers with the IP of your router or gateway, and domain_name_server with the IP of a DNS server. If you're on Wi-Fi, change "eth0" to "wlan0". Make sure ip_address fits your network scheme!  You can leave the DNS server set to 8.8.8.8.

For more info, check out this StackExchange post.

Comments

Popular posts from this blog

myDevices Cayenne

Raspberry Pi: Backup and Restore