5

For some strange reason, my Raspberry Pi is acting as the DHCP server on my home network. Whenever a computer boots up in our house, it's immediately told that the IP address for the DHCP server is my Pi.

I don't know if there's some way to prevent such an assignment outside of static setup (which is what our "main" computer is on now as a workaround), or whether it's something that needs to be done in the router admin page or in the Pi. I would like to prevent just turning off the Pi because I'm trying to keep it open as a file offload server.

My router - Netgear R6200, firmware V1.0.1.52_1.0.41 - is on 192.168.1.1, and my Pi is on 80 - every other device we own filters in between those two addresses.

  • 1
    If you're running Raspbian, if you do a dpkg -l | grep -i dhcp what do you get ? – Lawrence Jul 23 '14 at 3:01
  • Four entries, one of which is ii isc-dhcp-server 4.2.2.dfsg.1-5+deb70u6 - there's also a isc-dhcp-client (which I assume belongs), isc-dhcp-common (which I assume is a dependency of the server and the client) and udhcpd. – sctjkc01 Jul 23 '14 at 4:47
  • 1
    what Pi OS have you got, Raspian? – rob Jul 23 '14 at 9:39
  • I've got a Raspbian image installed, pre-configured for Jasper. – sctjkc01 Jul 24 '14 at 0:35
8

You need to disable the DHCP Server so that it doesn't run on startup.

I don't have a box handy at the moment, but this command should do what you need it to do

sudo update-rc.d isc-dhcp-server disable

This will stop the dhcp server from running on startup. If you have both servers installed, you may need to run that twice, replacing isc-dhcp-server with udhcpd the second time around.

3

You can try with:

sudo update-rc.d dhcpcd disable

or

sudo update-rc.d -f dhcpcd remove
  • 2
    Welcome to Raspberry Pi! Whilst this may theoretically answer the question, it would be preferable to include some explanation here, e.g. what do these commands do? – Ghanima Dec 25 '15 at 12:38
  • Isn't this self-explanatory? It's actually the correct answer for the Raspian Jessie Lite distribution. – Shy Robbiani Jan 11 '16 at 14:42
  • 2
    Wouldn't this remove the dhcp client daemon (dhcpcd), rather than the dhcp server (dhcpd) that the question asks about? – Luigi Plinge Mar 20 '16 at 3:47
0

edit the following in /etc/network/interfaces as

auto lo
iface lo inet loopback
iface eth0 inet static 
address <address>    
netmask <netmask>
gateway <gateway>
  • 1
    How does this prevent a DHCP server running on the Raspberry Pi? – Peter Mortensen May 6 '16 at 23:13
  • I am not sure it is preventing DHCP server but It maintains own static address instead of listening to DHCP ip address – Prasanna Anbazhagan May 11 '16 at 13:22
0
$ sudo update-rc.d dhcpcd disable

Second solution did not work for me it indeed removes the client and not the server.

Try:

$ sudo update-rc.d dhcpd disable && sudo update-rc.d -f dhcpd remove
  • Note that update-rc.d is atavistic and maintained for backward compatibility only. – goldilocks Oct 22 '17 at 16:27

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.