Home » Blog

Project Router Addon

 · 3 Minute · Michael Bäcker

Wie bringen wir einen Mehrwert in unser Heimnetzwerk

Linux

Raspberry Pi Installation

Mit dem Tool Raspberry Pi Imager erzeugt ihr euch einen USB Stick oder eine Memory Card für den Raspberry Pi. Bei der OS Auswahl empfehle ich im Moment (Mai 2025) Ubuntu Server 24.04 LTS 64 Bit

Das Bootet ihr dann und könnt euch danach mit dem Benutzernamen ubuntu und dem Passwort ubuntu per SSH auf der Maschine anmelden

Konfigurationen

Hostnamen setzen

sudo vi /etc/hostname

Nun folgende Tastenkombinationen

D (Zum löschen des Inhalts der Zeile
i (Zum aktivieren des Insert Modus)
pi-one (Euer Hostnamen)
ESC (zum beenden des Insert Modus)
:wq

Damit ist der Hostnane gesetzt

System aktualisieren

sudo apt update
sudo apt upgrade

Snap entfernen

  sudo -i
  apt remove snapd
  rm -r /snap /var/snap /var/lib/snapd
  # Eventuell nach einem Reboot nochmal ausführen

Docker installieren

  apt install docker.io docker-compose-v2
  usermod -a -G docker ubuntu
  exit

Netzwerkkonfiguration

Bitte an der folgenden Datei noch eventuell notwendige Änderungen vornehmen.

sudo vi /etc/netplan/50-cloud-init.yaml

/etc/netplan/50-cloud-init.yaml

network:
    ethernets:
        eth0:
            addresses:
            - 192.168.1.51/24
            dhcp4: false
            gateway4: 192.168.1.1
            nameservers:
                addresses:
                - 9.9.9.9
                - 1.1.1.1
            optional: true
    version: 2

Netzwerk Konfiguration kontrollieren

  ip addr ls dev eth0

  networkctl status eth0

Lokalen Resolver deaktivieren

sudo vi /etc/systemd/resolved.conf
[Resolve]
DNSStubListener=no
sudo systemctl restart systemd-resolved.service

Testen des Benutzers

id

Hier müsste in der Auflistung der Gruppen auch die Gruppe docker auftauchen. Wenn ja, dann sollte auch der nächste Befehl funktionieren

docker ps

Installation Pi-Hole als Docker Container

Als Benutzer ubuntu bitte folgendes ausführen

  cd
  mkdir docker docker/pi-hole
  cd docker/pi-hole
  mkdir etc-dnsmasq.d etc-pihole 

  vi docker-compose.yaml
# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
  pihole:
    deploy:
      replicas: 1
    container_name: pihole
    image: pihole/pihole:latest
    ports:
      # DNS Ports
      - "53:53/tcp"
      - "53:53/udp"
      # Default HTTP Port
      - "80:80/tcp"
      # Default HTTPs Port. FTL will generate a self-signed certificate
      - "443:443/tcp"
      # Uncomment the below if using Pi-hole as your DHCP Server
      #- "67:67/udp"
    environment:
      # Set the appropriate timezone for your location (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), e.g:
      TZ: 'Europe/Berlin'
      # Set a password to access the web interface. Not setting one will result in a random password being assigned
      FTLCONF_webserver_api_password: 'correct horse battery staple'
    # Volumes store your data between container upgrades
    volumes:
      # For persisting Pi-hole's databases and common configuration file
      - './etc-pihole:/etc/pihole'
      # Uncomment the below if you have custom dnsmasq config files that you want to persist. Not needed for most starting fresh with Pi-hole v6. If you're upgrading from v5 you and have used this directory before, you should keep it enabled for the first v6 container start to allow for a complete migration. It can be removed afterwards. Needs environment variable FTLCONF_misc_etc_dnsmasq_d: 'true'
      - './etc-dnsmasq.d:/etc/dnsmasq.d'
    cap_add:
      # See https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
      # Required if you are using Pi-hole as your DHCP server, else not needed
      - NET_ADMIN
      # Required if you are using Pi-hole as your NTP client to be able to set the host's system time
      - SYS_TIME
      # Optional, if Pi-hole should get some more processing time
      - SYS_NICE
    restart: unless-stopped
  docker compose pull
  docker compose up

  # Container mit STRG+c stoppen
  # Dauerhaft dann starten im Hintergrund mit
  docker compose up -d
  # Zum Stoppen nehmt ihr dann
  docker compose down

Pi-Hole

In Pi-Hole müssen wir noch etwas konfigurieren, damit wir auch DNS Abfragen stellen können

Aufruf der Oberfläche von Pi-Hole geht über: http://192.168.1.51/admin/ Sofern ihr keine andere IP Adresse verwendet.

An der Konsole / Terminal sehen wir, dass im Moment folgender Befehl nicht funktioniert.

nslookup www.youtube.com - 192.168.1.51

In der Weboberfläche müssen wir unter

  • Settings

    • DNS

      • Upstream DNS Server

        • IPv4 Quad9 unfilterd in der ersten Spalte
        • Cloudflare in der zweiten Spalte
      • Interface settings

        • Permit all origins setzen
      • Rate limiting

        • 0 queries within 0 seconds setzen

Und nun funktioniert das hier auch.

nslookup www.youtube.com - 192.168.1.51

Fritzbox DNS ändern

  • Heimnetz

    • Netzwerk

      • Netzwerkeinstellungen

        • IPv4-Einstellungen Lokaler DNS Server: 192.168.1.51 (oder welche IP Addresse ihr hier eingestellt habt)