How to configure Static IP for Raspberry Pi 3

A raspberry pi is often accessed via SSH or VNC viewer. Attaching the set of Monitor, Keyboard and Mouse to Raspberry Pi is not always recommended.

For accessing Raspberry Pi from a remote device we need to provide the following,
1. Username - Pi (by default)
2. Hostname or IP
3. Password configured for the user 'Pi'
4. Enabling SSH,VNC ports in Pi configuration

If multiple devices are plugged into your network, there is a high probability for IP shifts. To avoid this it is often suggested getting a static IP for Raspberry Pi.

Please follow following steps for enabling a static IP to your Raspberry Pi.


1. Login to the Raspberry Pi via SSH,
From router's admin page(192.168.1.1) you will get the IPs of connected devices.
Connect to the Raspberry Pi via SSH.
For Example, My Pi's IP was 192.168.1.3


2. Modify /etc/dhcpcd.conf and add your desired IP,
In my case, static IP I was preferring is 192.168.1.9. Add the following lines to the dhcpcd.conf file.
interface eth0
static ip_address=192.168.1.9/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1



3. Reboot Pi and try to connect via configured static IP,


To access your Pi through internet, please open port 22 for the new static IP in router's configuration.




Comments

Popular posts from this blog

The beginning of Data Quest

Setting up Python Flask server on internet via Port forwarding

Automate Blog Post creation using Blogger APIs and Python

Creation of Orphan Process in Linux using Python

How to remove TWRP from Android Phone - Nubia Z11 miniS