In this article you will learn how setup a Static IP in your Raspberry PI 3 with Raspbian OS.
* Here, i'm using the vim editor. You may preffer to use the vi or nano editors.
Target File
On Raspbian OS the file that has Static IP configuration are the “/etc/dhcpcd.conf”
Editing the File
So, let’s edit that file:
vim /etc/dhcpcd.conf
You will see the default configuration file, like this:
Find the eth0 (physical network adapter), as marked in red.
Changing the Settings
Now, uncomment IPV4 configuration lines and change the configuration as you need, as follow:
static ip_address=<FIXED IP ADDRESS/NETWORK MASK>
static routers=<YOU WiFi ROUTER ADDRESS>
static domain_name_servers=<YOUR WiFi ROUTER ADDRESS>
Im my case, I’m using 192.168.0.200 as Fixed IP and my Network Mask are 255.255.225.0 (in other words, /24). My Wireless router have 192.168.0.1 address.
Save and exit the editor (In vim use the command :wq). Now, reboot the raspberry:
reboot
and check the results
ifconfig
So, that’s it. 😉