Pihole + wireless hotspot

Hello,
I have raspberry Pi 3+ and I tried installing pihole along a wireless hotspot, but once I do the last step from this tutorial, pihole and internet doesn't work

add in /etc/dnsmasq.conf
interface=wlan0
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h
ot

^ this part

This is the output of ifconfig
pi@raspberrypi:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.136 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 blabla prefixlen 64 scopeid 0x0
inet6 blabla prefixlen 64 scopeid 0x20
ether blabla txqueuelen 1000 (Ethernet)
RX packets 1516 bytes 350462 (342.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5042 bytes 6059201 (5.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 231  bytes 18099 (17.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 231  bytes 18099 (17.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.42.1  netmask 255.255.255.0  broadcast 192.168.42.255
        inet6 blabla  prefixlen 64  scopeid 0x20<link>
        ether blabla  txqueuelen 1000  (Ethernet)
        RX packets 176  bytes 23509 (22.9 KiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 166  bytes 46481 (45.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

What I'm trying to do is have internet from eth0 and then use pihole to block ads through the wireless hotspot.

What ip are u using for your wlan?
I think I eventually just disabled the dnsmasq and used pihole build in dhcpd

I'll have to check my recipe but I'm not at home

Feel free to pester me tomorrow and I'll look up and post more the most recent recipe I'm using

1 Like

isee your issue i think since your wlan is at 192.168.42.1
the above dhcp-range should be
dhcp-range=192.168.42.2,192.168.42.20,255.255.255.0,24h

I've changed to dhcp-range=192.168.42.2,192.168.42.20,255.255.255.0,24h but still it doesn't work.

Maybe I'm not clear, I want to have a wireless hotspot with pihole's DHCP and have every client connecting to the hotspot to have ablock from pihole.

Here are my current settings:
$ cat /etc/network/interfaces
auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto eth0
auto wlan0

iface wlan0 inet static
  address 192.168.42.1
  netmask 255.255.255.0
  wireless-power off

up iptables-restore < /etc/iptables.ipv4.nat

$ cat /etc/dnsmasq.conf
interface=wlan0
dhcp-range=192.168.42.2,192.168.42.20,255.255.255.0,24h

at the end of /etc/dhcpcd.conf I have this:
interface wlan0
static ip_address=192.168.42.1/24
static routers=192.168.42.1
static domain_name_servers=127.0.0.1

$ cat /etc/resolv.conf
nameserver 127.0.0.1
search home

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