Define a Static IP Address for a Device or Machine in a Linux Environment
In this small article we will briefly show how to define a static IP address for a device or machine environment like a Raspberry Pi device or computer.
Having the device or machine fully configured and ready to go, open a terminal and execute the following to open the configuration document for DHCP the options:
sudo nano /etc/dhcpcd.conf
Before proceeding, we need to consider some valid points like:
ip_addressthe chosen static IP and type / subnet mask.
routersthe default router/access point IP in the same type.
domain_name_serversthe domain IP’s.
At the final of the document add the following block of data to define the static IP for the respective device or machine to the wlan0 interface:
# Static IP for WIFI
static domain_name_servers=192.168.1.1 126.96.36.199
After everything completed, reboot safely and check the respective IP for the
wlan0 interface by executing the
ip addr command on a terminal.
Hope you liked this small article, best regards, Ricardo Costa (Richards).