- First of all you need Network manager since the basic raspbian does not have a really good manager to share connections.
- Install the necessary network manager
sudo apt install network-manager network-manager-gnome openvpn \
openvpn-systemd-resolved network-manager-openvpn \
network-manager-openvpn-gnome
- Remove unneeded packages
sudo apt purge openresolv dhcpcd5
- Replace /etc/resolv.conf with a symlink to /lib/systemd/resolv.conf:
(do not execute this command on Raspbian 10, it will break your DNS || you can check with cat /etc/os-release )
sudo ln -sf /lib/systemd/resolv.conf /etc/resolv.conf
- Check policy:
apt-cache policy dhcpcd5
Create new file:
sudo nano /etc/apt/preferences.d/dhcpcd5
Containing:
Package: dhcpcd5
Pin: release *
Pin-Priority: -1
Run update:
sudo apt-get update
And check again:
apt-cache policy dhcpcd5
-
sudo apt-get purge dhcpcd5
-
reboot <- you should have NetworkManager (going forward to be called NM) taking over right next your clock.
-
Run this and normally you can see that lighttpd and dnsmasq are there
sudo netstat -nltup | grep 'Proto|:53 |:67 |:80 |:547 |:471[1-8] '
Go to your NM settings. Configure wifi normally as you would. Then go to your LAN settings, go straight to IPv4 settings and method -> Shared to other computers. In the address (optional) click on Add and put your local raspberry pi IP address (static). in your case, I would mimic the mac mini, so 192.168.2.1, 24 and leave for the time being the gateway free. Check if you can ping www.google.com
-
Install pihole
curl -sSL https://install.pi-hole.net | bash
-
Remove the middleman called mac-mini. This is the tricky part. It will ask for your IP stuff. You pick eth0 (as your devices will connect there), and as IP: 192.168.2.1/24 but as a gateway, you need to put 192.168.1.1/24 (since it is your landloard's wifi the gateway part). I have disabled the logs since it is bad for the sd card. But I show everything. But that is up to you. Pihole should have finished installing so far.
-
you go to 192.168.2.1/admin and settings -> dhcp server enabled -> 192.168.2.10 till 192.168.2.200 (your pick) and as a gateway again 192.168.1.1. You need to disable anything else for DHCP in your lan and let pihole deal with it.
-
connect your pihole to your hub. Now if that were a router instead of a hub, then you need to connect the LAN to the router's LAN and let it behave without DHCP. Otherwise you need to create a new subnet because the router will think it needs a new subnet. Let me know if it s a hub or a router you connect it to. The hub does not deal with IPs networking. A router has a separate port for "Internet". You then need to ask all your devices to be using your pi as both a gateway and a DHCP server.
I can't think of anything else. Let us know how it works.
PS: You will upon reboot that pi-hole is not working, since dnsmasq is taking over instead of pihole-FTL. We are still trying to resolve this as you can see from the thread you replied