2

I have set up my Raspberry Pi Zero with the USB Ethernet gadget as described by Adafruit.

This works wonderfully with static IP addresses. Now I want to put a little DHCP server in the Pi, so that I don't have to configure a static IP every time I connect to it.

Since I have no network connection, I've downloaded and manually installed using dpkg the isc-dhcp-server_4.3.1-6+deb8u2_armhf.deb and lsb-base_4.1+Debian13+nmu1_all.deb packages.

Next, I set up/etc/dhcp/dhcpd.conf:

ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;

subnet 192.168.7.0 netmask 255.255.255.0 {
range 192.169.7.10 192.168.7.20;
option routers 192.168.7.1;
option broadcast-address 192.168.7.255;
default-lease-time 600;
max-lease-time 7200;
option domain-name "local";
}

and /etc/default/isc-dhcp-server:

DHCPD_CONF=/etc/dhcp/dhcpd.conf
DHCPD_PID=/var/run/dhcpd.pid
INTERFACES="usb0"

And /etc/network/interfaces looks like this:

iface usb0 inet static
    address 192.168.7.1
    netmask 255.255.255.0
    network 192.168.7.0
    broadcast 192.168.7.255
    gateway 192.168.7.1

When I now try:

pi@raspberrypi:~ $ sudo service isc-dhcp-server restart
Job for isc-dhcp-server.service failed. See 'systemctl status isc-dhcp-server.service' and 'journalctl -xn' for details.
pi@raspberrypi:~ $ systemctl status isc-dhcp-server
● isc-dhcp-server.service - LSB: DHCP server
   Loaded: loaded (/etc/init.d/isc-dhcp-server)
   Active: failed (Result: exit-code) since Fri 2016-03-18 08:23:07 UTC; 16s ago
  Process: 454 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)
pi@raspberrypi:~ $ journalctl -xn
No journal files were found.

I don't have a clue what's wrong, and the lack of error messages is not helping. It seems like the DHCP server does not even start.

Anyone able to help?

2

I tired to copy your config to see if I could get it working ... I noted

`range 192.169.7.10 192.168.7.20;`

192.169 in the range is invalid for that subnet... should be:

`range 192.168.7.10 192.168.7.20;`

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.