📅 2015-Jan-23 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ dns, raspbian, static ⬩ 📚 Archive
I assume that Raspbian has been assigned an IP address automatically by your home wireless router using DHCP. To set a static IP address for it:
Run ifconfig
. Note the interface (say eth0
) and the values of the inet addr
, Bcast
and Mask
entries.
Run netstat -nr
. Note down the values of the Gateway
and Destination
entries.
Open the /etc/dhcpcd.conf
file in an editor.
Find the commented lines starting with “Example static IP configuration”. Uncomment the lines concerned with interface, ip_address and router and fill in your details there. For example:
interface eth0
static ip_address=192.168.0.99/24
static routers=192.168.0.1
You will also need to set the DNS servers manually, as described here.
Reboot the system and it should have the static IP address you assigned.
Tried with: Raspbian 9