Raspberry Pi set static ip address

first stop raspberry from getting ip from dhcp server
by uninstalling anoying package dhcpcd5

apt-get purge dhcpcd5 (removes all dhcp client config)

then do as root:

nano /etc/network/interfaces

look like this

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.2.18
netmask 255.255.255.0
gateway 192.168.2.1

now the dns server
 

/etc/resolvconf.conf

nameserver 192.168.2.1
nameserver 8.8.8.8
service networking restart
ping google.com (should work)


Posted in Linux Tagged with: , , ,

Leave a Reply