0

I have installed Raspbian using Noobs.

I need to set a static ip address.

The config files on my Pi bears not relation the articles I can find on the internet.

Can anyone point me to a good article or advise me of the settings.

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Thanks for reading.

Mesogi
  • 101
  • 1
  • 1

2 Answers2

1

It might be easier to get the mac address of the device (eg. 1), then assign one using your router (2). This avoids having to dig through config files as long as you have router admin access!

0

This article seems to be pretty detailed and shows exactly what you need to do:

In summary, do:

sudo nano /etc/network/interfaces

Change:

iface eth0 inet dhcp 

TO

iface eth0 inet static

Add:

address <desired_ip>
netmask <run ifconfig -> Mask field>
network <run netstat -> Destination>
broadcast <run ifconfig -> Bcast field>
gateway <run netstat -nr - look for gateway>

then

sudo rm /var/lib/dhcp/*
sudo reboot

To check: ifconfig and make sure you get that ip.