I'm currently working on a project of making an highly secured router with my RaspberryPi to navigate anonymously on the net. Yet, I'm not able to correctly configurate the daemon to finalise the wifi the Internet connection to the new server:
Indeed, when I do:
:~ $ sudo service isc-dhcp-server start
I get:
Job for isc-dhcp-server.service failed. See 'systemctl status isc-dhcp-server.service' and 'journalctl -xn' for details.
Here are my /etc/dhcp/dhcpd.conf
settings
authoritative;
#added
subnet 192.168.42.0 netmask 255.255.255.0{
range 192.168.42.10 192.168.42.50;
option broadcast-adress 192.168.42.255;
option routers 192.168.42.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name "local";
option domain-name-servers 8.8.8.8, 8.8.4.4;
}
And here are my /etc/network/interfaces
settings:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
iface eth0 inet manual
allow-hotplug wlan0
iface wlan0 inet static
adress 192.168.42.1
netmask 255.255.255.0
iface wlan0 inet dhcp
iface eth0 inet manual
allow-hotplug wlan0
iface wlan0 inet static
adress 192.168.42.1
netmask 255.255.255.0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
up iptables-restore < /etc/iptables.ipv4.nat
My RaspberryPi is wirely connected but has a wifi dongle
Here is the systemctl status isc-dhcp-server.service
:~ $ systemctl status isc-dhcp-server.service
● isc-dhcp-server.service - LSB: DHCP server
Loaded: loaded (/etc/init.d/isc-dhcp-server)
Active: failed (Result: exit-code) since Tue 2016-06-07 00:13:45 CEST; 53s ago
Process: 18098 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)
Some parts are written with a scary red...
and here is the journalctl
-- Logs begin at Mon 2016-06-06 21:17:01 CEST, end at Tue 2016-06-07 00:18:32 CEST. --
Jun 07 00:13:45 raspberrypi isc-dhcp-server[18098]: than a configuration issue please read the section on submitting
Jun 07 00:13:45 raspberrypi isc-dhcp-server[18098]: bugs on either our web page at www.isc.org or in the README file
Jun 07 00:13:45 raspberrypi isc-dhcp-server[18098]: before submitting a bug. These pages explain the proper
Jun 07 00:13:45 raspberrypi isc-dhcp-server[18098]: process and the information we find helpful for debugging..
Jun 07 00:13:45 raspberrypi isc-dhcp-server[18098]: exiting.
Jun 07 00:17:01 raspberrypi CRON[18118]: pam_unix(cron:session): session opened for user root by (uid=0)
Jun 07 00:17:01 raspberrypi CRON[18122]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jun 07 00:17:01 raspberrypi CRON[18118]: pam_unix(cron:session): session closed for user root
Jun 07 00:18:32 raspberrypi sudo[18139]: pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/journalctl -xn
Jun 07 00:18:32 raspberrypi sudo[18139]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
There was to things:
The most obvious one was to write address with two "d" here:
The second one was to start the wireless network by running:
And I would have been able to start
service isc-dhcp-server
I made it thanks to this raspberrypihq tutorial to turn a RPi into a routeur.Yet, I now have issues to run
sudo update-rc.d isc-dhcpd-server enable
. Any help would be warmly welcomed!IN CASE IT HELPS ANYONE I've just been right through this exasperating issue, on DietPi (Debian Buster) on a Pi Zero W and HAVE BOTTOMED THE PROBLEM.
isc-dhcp-server is excellent but DOES HAVE this quirk, as noted by the original enquirer above. I've bottomed the problem - it's not a bug - and this is the detail of the reason:
BUT that situation, is immediately one of those which isc-dhcp-server does not like: if you try to start it before hostapd, it will fail, complaining that there is no subnet for it to listen on.
It's taken me about five hours, I hope this saves someone some time. My distilled note:
SORTING ISC-DHCP-SERVER alongside HOSTAPD: THE SOLUTION
YOU HAVE TO follow THIS SEQUENCE:
THEN the Access Point should be UP and ready to accept clients.
Those are my addresses of course / edit to suit your need.
TWO MORE TIPS: Config files hostapd.conf and dhcp.conf can drive you mad also: -here are working samples. IMPORTANT: do not sweat the 'drivername' in hostapd.conf: it's not needed. 'Commented out' is fine:
hostapd.conf
interface=wlan0
#driver=brcmfmac
ssid=THIS-IS-MY-AP
country_code=US
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
wpa_group_rekey=86400
ieee80211n=1
wme_enabled=1
dhcpd.conf
COMMENT OUT BOTH OF THE TEMPLATES' 'option domain..' lines.. then ADD THIS AT BOTTOM:
subnet 10.1.1.0 netmask 255.255.255.0 { range 10.1.1.100 10.1.1.109; option broadcast-address 10.1.1.255; option routers 10.1.1.1; default-lease-time 600; max-lease-time 7200; option domain-name "mynetwork.org"; option domain-name-servers 8.8.8.8, 8.8.4.4; }
Though this work on Pi it was on DietPi which is straight Debian, so this same advice should suit many Linuxes, including Ububtus of many flavours.
GOOD LUCK ALL