0

This question already has an answer here:

I recently bought a Raspberry Pi 2B and was setting it up. I was told to make the IP static by changing the line

iface eth0 inet dhcp

However, the IP config file did not contain the word dhcp anywhere. It looked something like this

 # 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
 Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

Then I changed it to this:

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

auto lo
iface lo inet loopback

iface eth0 inet static
 address 192.168.1.121
 network 192.168.1.0
 netmask 255.255.255.0
 broadcast 192.168.1.255
 gateway 192.168.2.1

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

allow-hotplug wlan1
iface wlan1 inet manual
 Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

I tried to change manual to static, but nothing worked. Can someone please tell me what to do?

marked as duplicate by Milliways, Ghanima, Jacobm001, Patrick Cook, mpromonet Nov 13 '15 at 22:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

For a static ip configuration, change the line

iface eth0 inet manual

in /etc/network/interfaces to

iface eth0 inet static
address 192.168.0.97   
netmask 255.255.255.0  
gateway 192.168.0.1

For a dynamic ip configuration, use dhcp to automatically assign a ip adress to your raspberry pi and change the line to

iface eth0 inet dhcp

Not the answer you're looking for? Browse other questions tagged or ask your own question.