This guide explains how to configure a static IP address on your Raspberry Pi.
Ctrl
+ Alt
+ T
.
If you’re connected via SSH, you are already in a terminal session.
List Network Interfaces
Identify Your Interface
eth0
for wired connection or wlan0
for wireless). Note down the interface name.Find Current IP Address
inet
line to find your current IP address. Note down the IP address, subnet mask, router (gateway), and DNS server.dhcpcd
Configuration FileOpen the Configuration File
nano
to edit the dhcpcd.conf
file:Add Static IP Configuration
Save and Exit
Ctrl
+ X
to exit, then Y
to save changes, and Enter
to confirm the file name.