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.

sctjkc01
  • 306
  • 1
  • 3
  • 10
  • 1
    If you're running Raspbian, if you do a dpkg -l | grep -i dhcp what do you get ? – Lawrence Jul 23 '14 at 03: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 04:47
  • 1
    what Pi OS have you got, Raspian? – rob Jul 23 '14 at 09:39
  • I've got a Raspbian image installed, pre-configured for Jasper. – sctjkc01 Jul 24 '14 at 00:35

4 Answers4

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.

Lawrence
  • 2,662
  • 14
  • 14
2

You can try with:

sudo update-rc.d dhcpcd disable

or

sudo update-rc.d -f dhcpcd remove
jchanger
  • 103
  • 4
abcd
  • 31
  • 1
  • 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. –  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 03: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>
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
Mr Ben
  • 1