How to configure a static ip wired address for the Raspberry Pi

staticipHow to configure a static ip wired address for the Raspberry Pi? It’s really easy to do, this is for a wired connection! Log in with ssh to your pi (how to) and be sudo:

sudo -s

Edit the following file with VI

vi /etc/network/interfaces

Delete everything you see and past the following:


auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.2
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255

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

Change the following lines if you want:


address 192.168.1.2 (change to the ip you use)
gateway 192.168.1.1 (the ip of your router
netmask 255.255.255.0 (change if wanted)
network 192.168.1.0 (it's always the same as you ip, except the last digit is a 0)
broadcast 192.168.1.255 (same as above, but ending in 255)

Reboot with reboot in terminal and its done.

Done!

Sidebar