I can't update an IP address from DHCP to static. I changed the /etc/network/interfaces
file and I rebooted the system but IP still is the same as the one that DHCP gave me before.
I changed /etc/network/interfaces
to:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.205
netmask 255.255.255.0
gateway 192.168.1.1
I got this error in syslog when I executed /etc/init.d/networking restart
:
Aug 30 08:17:01 raspberrypi CRON[1337]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Aug 30 08:34:22 raspberrypi systemd[1]: Stopping LSB: Raise network interfaces....
Aug 30 08:34:22 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Tue Aug 30 08:34:52 2016 [try http://www.rsyslog.com/e/2007 ]
Aug 30 08:34:22 raspberrypi networking[1407]: Deconfiguring network interfaces...done.
Aug 30 08:34:22 raspberrypi systemd[1]: Starting LSB: Raise network interfaces....
Aug 30 08:34:22 raspberrypi networking[1428]: Configuring network interfaces.../etc/network/if-pre-up.d/iptables: 2: /etc/network/if-pre-up.d/iptables: /sbin/iptable-restore: not found
Aug 30 08:34:22 raspberrypi networking[1428]: run-parts: /etc/network/if-pre-up.d/iptables exited with return code 127
Aug 30 08:34:22 raspberrypi networking[1428]: ifup: pre-up script failed.
Aug 30 08:34:22 raspberrypi networking[1428]: failed.
Aug 30 08:34:22 raspberrypi systemd[1]: Started LSB: Raise network interfaces..
raspberry-pi3
uname -a
gives:
Linux raspberrypi 4.4.11-v7+ #888 SMP Mon May 23 20:10:33 BST 2016 armv7l GNU/Linux
And /etc/os-release
contains:
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
I tried to execute the script /sbin/ifup
, result:
root@raspberrypi:/sbin# ./ifup -a
/etc/network/if-pre-up.d/iptables: 2: /etc/network/if-pre-up.d/iptables: /sbin/iptable-restore: not found
run-parts: /etc/network/if-pre-up.d/iptables exited with return code 127
./ifup: pre-ifup script failed.