Tag Archives: pi

change IP & restart the network

sudo nano /etc/network/interfaces

change

iface eth0 inet dhcp

into

iface eth0 inet static
    address 192.168.1.250
    netmask 255.255.255.0
    gateway 192.168.1.1

or whatever your desired address might be. when restarting the network you might see:

pi@raspberrypi ~ $ sudo /etc/init.d/networking restart
[warn] Running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces … (warning).
[….] Reconfiguring network interfaces…RTNETLINK answers: No such process

… and the network is gone. you can’t reach the pi via the ethernet anymore. hussa!

reason: /etc/init.d is using “ifup -a”. interfaces without “auto” will not restart…

add “auto eth0” to /etc/network/interfaces

even this will lead to

pi@raspberrypi ~ $ sudo /etc/init.d/networking restart
[warn] Running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces … (warning).
[….] Reconfiguring network interfaces…RTNETLINK answers: File exists
Failed to bring up eth0.
done.

after all the network is up again and you can reach the pi again

try stop/start the network via the deamon

pi@raspberrypi ~ $ sudo invoke-rc.d networking restart
[warn] Running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces … (warning).
[….] Reconfiguring network interfaces…RTNETLINK answers: File exists
Failed to bring up eth0.
done.

hmm. still an error…

 sudo dhclient eth0

leads to

pi@raspberrypi ~ $ sudo dhclient eth0
RTNETLINK answers: File exists

 

pi@raspberrypi ~ $ sudo dhclient eth0 -r

pi@raspberrypi ~ $ sudo invoke-rc.d networking stop

pi@raspberrypi ~ $ sudo invoke-rc.d networking start

will do the job. remember that you can’t do this remote because the connection is lost.

pi@raspberrypi ~ $ sudo invoke-rc.d networking stop && sudo invoke-rc.d networking start
[ ok ] Deconfiguring network interfaces…done.
[ ok ] Configuring network interfaces…done.

will work while connected via ssh