They run an mDNS repeater in a Docker container.
Sounds like a good solution. So i did the following right now with the angelnu/mdns_repeater
image::
version: '2'
services:
homebridge:
container_name: homebridge
image: homebridge/homebridge:latest
restart: always
environment:
- PGID=1000
- PUID=1000
- HOMEBRIDGE_CONFIG_UI=1
- HOMEBRIDGE_CONFIG_UI_PORT=8087
volumes:
- ./volumes/homebridge:/homebridge
logging:
driver: json-file
options:
max-size: "10mb"
max-file: "1"
networks:
- proxy
ports:
- 8087:8087 #webapp
- 5353:5353 #homebridge
- 21064:21064 #homebridge, default is 21063
- 21063:21063 #just also test 21063 as mentioned above
networks:
proxy:
name: proxy_proxy_network
external: true
services:
app:
container_name: nginx_proxy_manager
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
networks:
- proxy_network
mdns-reflector:
build:
context: .
dockerfile: Dockerfile
image: docker.io/yuxzhu/mdns-reflector:latest
container_name: mdns-repeater
command: mdns-reflector -fnl info -- enp3s0 br-98eea5ec0569
network_mode: host
restart: unless-stopped
networks:
proxy_network:
enp3s0
is the network of my host:
$ ip addr | grep enp3s0
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
inet 192.168.178.34/24 brd 192.168.178.255 scope global dynamic noprefixroute enp3s0
br-98eea5ec0569
is hopefully the correct entry for docker NIC:
$ ip addr | grep br-98eea5ec0569
9: br-98eea5ec0569: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
inet 172.23.0.1/16 brd 172.23.255.255 scope global br-98eea5ec0569
23: vethb0295dc@if22: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-98eea5ec0569 state UP group default
41: vethb88d868@if40: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-98eea5ec0569 state UP group default
307: veth11c8b00@if306: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-98eea5ec0569 state UP group default
325: veth21d7ce0@if324: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-98eea5ec0569 state UP group default
172.23.0.1/16
sounds good as
$ docker inspect proxy_proxy_network
[
{
"Name": "proxy_proxy_network",
[...]
"Config": [
{
"Subnet": "172.23.0.0/16",
"Gateway": "172.23.0.1"
}
[...]
"Containers": {
"0df4e2318334ee005ab94e9506e6efda567452fb84891ff0427deed38a402083": {
"Name": "nginx_proxy_manager",
[...]
"IPv4Address": "172.23.0.2/16",
[...]
},
"64c74a6a1d58564ffe6ab5f50d545e9b53ece5238204210456ba3260d25311c2": {
"Name": "gatus",
[...]
"IPv4Address": "172.23.0.3/16",
[...]
},
"f1ce0a399e11ae9cf1b1a9368c4e6aa72aad1240531828b0f980e52262b53391": {
"Name": "homebridge",
[...]
"IPv4Address": "172.23.0.4/16",
[...]
Inside the mdns-repeater logfiles i can this now. The homebridge container is 172.23.0.4
, 192.168.178.34
the host which runs docker. There is also a lot of other stuff going around, like traffic from my fire tv stick in my network, hm.
So gatus can see homebridge. And i can also reach the homebridge web ui with http://192.168.178.34:8087
. But i canât add homebridge to homekit, it seems like the mDNS has problems.
$ nmap -p 8087 172.23.0.4
Starting Nmap 7.94 ( https://nmap.org ) at 2024-01-04 10:03 CET
Nmap scan report for 172.23.0.4
Host is up (0.00028s latency).
PORT STATE SERVICE
8087/tcp open simplifymedia
Nmap done: 1 IP address (1 host up) scanned in 0.96 seconds
$ nmap -p 5353 172.23.0.4
Starting Nmap 7.94 ( https://nmap.org ) at 2024-01-04 10:03 CET
Nmap scan report for 172.23.0.4
Host is up (0.00025s latency).
PORT STATE SERVICE
5353/tcp closed mdns
Nmap done: 1 IP address (1 host up) scanned in 0.08 seconds
(PS: I am trying to use yuxzhu/mdns-reflector
instead jdbeeler/mdns-repeater
. My compose file with jdbeeler/mdns-repeater
was this:
mdns_repeater:
container_name: mdns-repeater-jdbeeler
image: jdbeeler/mdns-repeater:latest
network_mode: "host"
privileged: true
environment:
- EXTERNAL_INTERFACE=enp3s0
- DOCKER_NETWORK_NAME=proxy_proxy_network
- USE_MDNS_REPEATER=1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
But docker logs mdns-repeater-jdbeeler
gives me no error message but also nothing else, just an empty output)