3

I have Raspbian Jessie on RPI 2 B, I cannot set my wired NIC with a static IP address.

I have uninstalled raspberrypi-net-mods ifplugd, because have a lot of stability issues and insists on uses dhcpcd.....

Now it works fine, but it uses isc-dhcp-client , and I don't want it.

My configuration

root@raspberrypi:~# egrep -v "#|^$" /etc/network/interfaces
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static
        address 192.168.80.148
        netmask 255.255.255.0
        gateway 192.168.80.1
        dns-nameservers 192.168.80.1

Logs show as follows:

Nov 26 18:04:58 raspberrypi systemd[30657]: Starting Default.
Nov 26 18:04:58 raspberrypi systemd[30657]: Reached target Default.
Nov 26 18:04:58 raspberrypi systemd[30657]: Startup finished in 37ms.
Nov 26 18:04:58 raspberrypi systemd[1]: Started User Manager for UID 0.
Nov 26 18:05:01 raspberrypi CRON[30683]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Nov 26 18:07:51 raspberrypi dhclient: DHCPREQUEST on eth0 to 192.168.80.1 port 67
Nov 26 18:07:51 raspberrypi dhclient: DHCPACK from 192.168.80.1
Nov 26 18:07:51 raspberrypi systemd[1]: Reloading LSB: start Samba SMB/CIFS daemon (smbd).
Nov 26 18:07:51 raspberrypi smbd[30752]: Reloading /etc/samba/smb.conf: smbd.
Nov 26 18:07:51 raspberrypi systemd[1]: Reloaded LSB: start Samba SMB/CIFS daemon (smbd).

Note I've tried auto instead allow-hotplug but if I reboot router which RPI is plugged it lost its link and I have to poweroff in a dirty way... And logs showing that it is using DHCP:

Any ideas?

  • This and this may help. Could you paste the output into a codeblock so it is possible to read please? Also are you sure the router uses addresses within the range 192.168.80.XXX (model of router may help as well). Also I think DNS needs to be set in /etc/resolv.conf – Wilf Nov 26 '15 at 22:21
  • 2
    Possible duplicate of How do I set up networking/WiFi/Static IP – Wilf Nov 26 '15 at 22:31
  • It's not a duplicate question, I don't want to use dhcp. – sebelk Nov 26 '15 at 23:26
  • I've read the docs and really I haven't found the reason why dhcp is used ignoring the interfaces file. I've double checked range, in fact it's not the only host attached to it. I'm not using the wireless NIC, only the wired one. – sebelk Nov 26 '15 at 23:34
  • 1
    Have a look at this if you want to know how you can disable all the autoconfiguration, networking daemons, etc., and just set up networking yourself -- for a static address pretty sure you just use ip addr add instead of dhclient, see man ip-address and the certainly many online examples, including at our our larger sibling site Unix & Linux. If you get that to work you can add your own answer. – goldilocks Nov 27 '15 at 18:46
8

I'm still not fully up with systemd, however if you run

sudo service networking status

Do you get a message like

Warning: Unit file changed on disk, 'systemctl daemon-reload' recommended.

I did after editing /etc/network/interfaces

If so, run

sudo systemctl daemon-reload
  • That it solved it! – sebelk Nov 27 '15 at 21:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.