PiHole, with a bridge device?

Quick question for all you linux gurus.

I would like to have PiHole run on a box that is in bridged mode or less technically as a bump in the wire. The goal would be to use PiHole as DNS, DHCP, and vnstat to monitor network usage.

However I keep running into two snags.

  1. When I unplug my 3rd nic all DNS fails on box and throughout the rest of the network.
    The box has the following setup:

bridge0 (created by me with a static address of 192.168.0.197)
enp1s0 (onboard nic)
enp4s0 (realtek PCI nic)
enxd8eb97b96854 (USB3 Nic used for setup)

[Redacted]

sudo sysctl -w net.ipv4.ip_forward=1
sudo ifconfig bridge0 192.168.0.197

  1. The script needs to be manually run, once I figure out why I can not pass DNS requests I would like these settings to be saved and applied on boot.

I forgot to mention I have PiHole set to listen on all internal interfaces.
Interface listening behavior: All internal.

My setup looks like below:
Internet > Firewall > PiHole (bridge0 (enp1s0 > enp4s0)) + enxd8eb97b96854 > Core switch

when you say you have pihole set to listen on all internal do you mean listen on all interfaces allow all origins or listen on all interfaces and only reply if one hop away?

with the bridge setup i would suggest running pihole -r selecting reconfigure and selecting the bridge0 as the interface you wanty to use as well as verifying the IP address and gateway within that script

1 Like

I ran pihole -r , by default it wanted to choose enxd8eb97b96854 (usbether) as the network adapter's IP during the wizard I since changed it to be bridge0 , still when I unplug the usbether adapter DNS stops resolving external hosts network wide.

Here is a rough diagram.

provided the ipv4 address is set to 192.168.0.197 and the gateways is set properly you should not lose anything when you disconnect the usb adaptor. this assumes that your routing and network is set up properly

Ah, you pointed me in the right direction. Carelessly I had overlooked the fact the box was trying to use the gateway on the USB nic and none was assigned to the bridge.

-duh-

thanks for the tip!

1 Like

i may not always know the answer but i can think out loud REAL good

1 Like

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