Pi router with pihole - internet from wifi, routed to ethernet

  1. First of all you need Network manager since the basic raspbian does not have a really good manager to share connections.
  2. Install the necessary network manager
sudo apt install network-manager network-manager-gnome openvpn \
openvpn-systemd-resolved network-manager-openvpn \
network-manager-openvpn-gnome
  1. Remove unneeded packages
    sudo apt purge openresolv dhcpcd5
  2. 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
  3. 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

  1. sudo apt-get purge dhcpcd5

  2. reboot <- you should have NetworkManager (going forward to be called NM) taking over right next your clock.

  3. 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

  1. Install pihole
    curl -sSL https://install.pi-hole.net | bash

  2. 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.

  3. 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.

  4. 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. :wink:

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 :wink: