$ sudo nano /etc/network/interfaces
Change:
iface eth0 inet dhcp
to
iface eth0 inet static
Below this line enter the following, replacing x where necessary for your network config.
address 192.168.x.x
netmask 255.255.255.0
network 192.168.x.0
broadcast 192.168.x.255
gateway 192.168.x.x
Thanks, plain and simple works for me!
The file is at /etc/network/interfaces. So the command should have been:
$ sudo nano /etc/network/interfaces
I had to restart the raspberry,
some time later i found this:
http://elinux.org/RPi_Setting_up_a_static_IP_in_Debian
here it works without a restart, its only a networ restart.
But thank you
Did not work for me. The file at /etc/network/interfaces was a one-byte file with nothing in it. I put my static network information in the file and rebooted the PI. It still used DHCP to configure eth0.