Pi-Hole und FritzBox Setup Anleitung

Dann mach doch mal ein ifconfig auf OSMC und schau was die Kiste an Adressen hat.
Wenn du die Adresse des DNS Servers geändert hast musst du den OSMC auch neu starten. Denn falls dieser eine dynamische ip hat, zeigt dessen DNS Abfrage immer noch zu deine FritzBox. Kannst du dir mit: cat /etc/resolv.conf anschauen wie dort der DNS Server gesetzt ist.

Hallo,
ich habe den Anleitungen hier gefolgt und bekomme das Pi-Hole nicht zum laufen d.h. Werbung wird weiterhin angezeigt. Meine Konfiguration:

FRITZ!Box 5490
PIv6 deaktiviert
Home Network -> Home Network Overview -> Details for Pi-Hole -> Always assign this network device the same IPv4 address


Home Network -> Home Network Overview -> Network Settings -> IPv4 Adresses -> Local DNS server: Pi-hole IP

Pi-hole auf Raspberry Pi 3 mit Stretch
Settings -> DNS -> FB-IP als Custom 1 eingegeben, alle anderen deaktiviert
2018-07-10%2010_41_24-Pi-hole%20Admin%20Console
Advanced DNS settings -> alles deaktiviert
2018-07-10%2010_41_50-Pi-hole%20Admin%20Console

Würde mich sehr über Hilfe freuen.

Im Pi-Hole sollte die IP der FB im DNS-Bereich raus, dafür mehrere DNS (z.B. Google, OpenDNS, usw.) einschalten.

Durch die FB bekommen alle Geräte per DHCP eine IP und als DNS die IP vom Pi-Hole mitgeteilt. DNS-Anfragen gehen ans Pi-Hole, werden gefiltert und an die jeweils angekreuzten DNS-Server weitergeleitet.

Bei den Endgeräten würde ich den verwendeten DNS prüfen (z.B. bei Android mit der App Aida64).

Oder aber so lassen und dies machen (so funktioniert auch das Auflösen der lokalen Adressen):

1 Like

EDIT: Problem gelöst. Der Fehler lag darin, dass ich in der Konfiguration des Pi-Hole den falschen Netzwerkadapter (LAN statt WLAN) gewählt habe.

Viele Dank für eure Antworten. Ich habe beides probiert und nach einem DNS Flush und Reboot meines Rechners konnte mein Browser keine url's mehr auflösen. Eine Idee, was ich falsch mache?

Szenario 1

Szenario 2


Hallo zusammen,

vielen Dank für die zahlreichen Tips.

Ich habe mal versucht, das alles (graphisch) zusammenzufassen.

Wie unten dargestell, läuft bei mir dieses Szenario zuverlässig. Ob tatsächlich alles richtig eingestellt ist, weiss ich jedoch noch nicht. Verbesserungsvorschläge sind herzlich willkommen.

Grüße
Hausmeister

pihole-Konfiguration_Fritzbox.pdf.zip (603.1 KB)

Ich habe spaßeshalber mal Deine Konfiguration umgesetzt. Allerdings werden bei mir im Dashbord und in Query Log nur IPs und keine DNS-Namen angezeigt.

Follow up:
Nun habe ich es zum Laufen gebracht. Ich habe dezidiert die Fritzbox als Router angegeben:

Danke für die Rückmeldung.

Wo kann ich die Fritzbox als Router angeben? Finde diesen Eintrag bei mir nicht :thinking:

Grüße
Hausmeister

das geht nur in der aktuellen Beta-Version.
Settimgs-->DNS-->Use Conditional Forwarding

Super. Danke Dir.

Grüße
Hausmeister

wie läuft die Beta? Wenn sie Stabil läuft würde ich das auch gerne ausprobieren. :slight_smile:

Die beta läuft ohne Probleme.

Wie installiert man die Beta-Version?

Grüße
Hausmeister

Hier die Infos zur beta
https://pi-hole.net/2018/03/24/help-us-beta-test-ftldns/

Falls es Probleme gibt also das Update quasi gar nicht startet dann stelle die systemsprache vom raspi auf englisch und starte ihn neu.

Hallo, bin neu hier und auch mit Pi-hole sowie raspberry.

Eigentlich hatte ich es wie Variante 2 eingestellt. Also Fritzbox macht DHCP Server. PI IP ist als lokaler DNS (ipv4 und ipv6) eingetragen und unter DNS Rebindschutz auch.

Im Pi hole sind diverse ext. DNS Server eingestellt. So geht bei mir keine lokale Adressauflösung (z.B. Fritz.box). Egal, wie die beiden Haken bei den DNS Einstellungen im pi sind.

Wenn ich nun die Fritzbox IP im pi als DNS Server ergänze, dann funktioniert die lokale Auflösung solange ich nur 2 weitere ext. DNS Server angebe. Wenn ich mehrere aktiviere, funktioniert es nur sporadisch. Ich vermute, dass der pi immer 2 Server abfragt. Wenn die Fritzbox zufällig nicht dabei ist, geht's nicht.

Meine jetzige Lösung ist: In pi nur auf Fritzbox verweisen. Vorteil: Lokale Auflösung funktioniert, Kindersicherung funktioniert, pi hole Schutz auch für Gastzugang.

Jetzt überlege ich aber, ob es andersrum nicht sinnvoller wäre? Dann müsste auch alles funktionieren. Zusätzlich würde die bessere DNS Auswahl des pi hole wirken. Denn der verteilt die Anfragen auf unterschiedliche Server, somit hat kein Anbieter die ganze Historie.

Oder doch besser die beta mit conditional forwarding und Variante 2 wie zuerst?

Auch würde ich gerne mal mit FTLDNS testen. Damit ist das doch die einzige Alternative, die mit Fritzbox funktioniert, oder?

Apropos?: Oben wurde die Anleitung Help Us Beta Test FTLDNS – Pi-hole verlinkt. Warum ist die komplett anders als Redirecting...

Welche brauche ich? Beide?

Danke.

ip6tables -A INPUT -p tcp --destination-port 443 -j REJECT --reject-with tcp-reset
ip6tables -A INPUT -p udp --destination-port 80 -j REJECT --reject-with icmp6-port-unreachable
ip6tables -A INPUT -p udp --destination-port 443 -j REJECT --reject-with icmp6-port-unreachable

Servus in die Runde. Ich habe jetzt mal eine ganz doofe Frage. Wie und wo genau muss ich diese Befehle eingeben? Wenn ich mich über Putty aufs Pi klinke und versuche, diese Befehle auszuführen, erhalte ich eine Errornachricht, dass eventuell ip6_tables aktuallisiert werden soll bzw der Kernel.

Nachtrag: Ich habe alles so ausgeführt, wie im Blogbeitrag von Firewall für Raspberry Pi mit iptabels - Michis Blog aufgeführt. Nachfolgende Fehler werden beim Ausführen des Skripts ausgegeben:

pi@raspberrypi:~ $ sudo sh /usr/local/bin/iptables.sh
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.50-v7+/modules.dep.bin'
modprobe: FATAL: Module ip6_tables not found in directory /lib/modules/4.14.50-v7+
ip6tables v1.6.0: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.

Hallo msatter,

wie lauten die genauen Befehle hierzu?
Der Versuch `

sudo apt install ip6tables-persistent

auszuführen, resultiert ebenfalls in einer Errornachricht`

Grüß Dich,

ich habe jetzt mit sudo apt install iptables und sudo apt install iptables-persistent die nötigen installationen vorgenommen. Wie muss ich nun aber die oben genannten Befehle umändern? Weder mit

ip6tables -A INPUT -p tcp --destination-port 443 -j REJECT --reject-with tcp-reset

noch mit

iptables -A INPUT -p tcp --destination-port 443 -j REJECT --reject-with tcp-reset

komme ich weiter. Mir wird lediglich das gleiche wie vorher ausgegeben:

iptables v1.6.0: can't initialize iptables table `filter': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.

oder gleich nach dem shh-login mit sudo -i Root-Rechte verschaffen

Danke Euch, hat nun funktioniert!