This guide will help you set a static IP address in the 192.168.1.0/24 range on your Raspberry Pi.
First, identify your network interface:
ip a
Look for the interface you're using (usually eth0
for Ethernet or wlan0
for Wi-Fi).
Open the dhcpcd configuration file:
sudo nano /etc/dhcpcd.conf
Add the following lines at the end of the file, adjusting as needed:
interface eth0 # or wlan0 for Wi-Fi static ip_address=192.168.1.100/24 static routers=192.168.1.1 static domain_name_servers=192.168.1.1 8.8.8.8
192.168.1.100
with your desired IP addressrouters
and domain_name_servers
if your network uses different addresses
Press Ctrl+X
, then Y
, then Enter
to save and exit.
Restart the networking service to apply changes:
sudo service dhcpcd restart
Check if the new IP address has been applied:
ip a
Look for your interface and confirm the new IP address.
If you encounter issues:
sudo reboot