Pi-hole + unbound + hostapd: correct dhcpcd.conf configuration?

Hello,

on a clean Raspberry pi os installation, I am configuring a small test rig to analyze wireless traffic of connected devices. Among the other applications, I have installed also Pi-hole with unbound. I am using it as dhcp server also, to handle the devices that connect to wlan0 and filter the traffic on that interface, while leaving eth0 to receive dynamic configuration from the router I connect this rig.

To do so, I've installed hostapd and configured /etc/dhcpcd.conf as suggested on the Raspberry website. Then, after the Pi-hole installation, my /etc/dhcpcd.conf file ended containing this parameters:

interface wlan0
static ip_address=10.10.0.1/24
nohook wpa_supplicant
interface wlan0
static ip_address=10.10.0.10/24
static routers=10.10.0.1
static domain_name_servers=208.67.222.222 208.67.220.220

The first two parameters have been entered by hand. Originally I had configured the Raspberry to have a fix wlan0 ip of 10.10.0.1 and clients pool from 10.10.0.20 to 10.10.0.50.
The latest three have been added by Pi-hole. Since I would like to keep the configuration files clean, how can I arrange this? I don't understand why there are OpenDNS's dns inside. Also now the Raspberry have a static ip of 10.10.0.10 on the wlan0 and I don't understand where it came from and what ip address put into the Pi-hole dhcp configuration in the router field.

I am loosing myself into these parameters... Thank you.

This was not entered by Pi-hole. Our install does not change the assigned nameservers of the host device.

Are these the DNS servers provided by your DHCP server prior to installing Pi-hole?

When you installed Pi-hole, did you choose to make the IP static?

Ops, it is possible they are what remain of the initial Pi-hole configuration, since I've installed unbound only after the first start? So they are not in use anymore and eventually I could delete the row?

Yes on the wlan0. And now I believe I have accidentally added a "0" so that why how wlan0 has 10.10.0.10 instead of 10.10.0.1 but I'm a bit confused on where to make order to the configuration.

You can edit these parameters in file /etc/dhcpcd.conf to meet your needs.

Then restart the service with sudo service dhcpcd restart

1 Like

So I just left the parameters I've entered for making hostapd working:

interface wlan0
static ip_address=10.10.0.1/24
nohook wpa_supplicant

and commented out the rest as I suppose that the latest "static ip_address=" was the one giving the final static ip during the boot and that's why wlan0 turned out having 10.10.0.10 as static ip.
Everything seems working properly now, thank you very much!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.