goodrobots / maverick

UAV Autonomous Systems Management
https://goodrobots.github.io/maverick/
MIT License
171 stars 61 forks source link

zeroconf doesn't work #912

Closed fnoop closed 4 years ago

fnoop commented 4 years ago
[dev] [mav@maverick-ubuntuvm ~/software/gstreamer/lib/girepository-1.0]$ scp GstWebRTC-1.0.typelib maverick-nano.local:/var/tmp
ssh: Could not resolve hostname maverick-nano.local: Name or service not known
lost connection
fnoop commented 4 years ago

Two things:

fnoop commented 4 years ago

avahi-browse -a doesn't find maverick devices. accessing maverick devices through the local hostname does work however (where are the responses coming from?)

On a nano which stops working very quickly after restarting avahi-daemon, lots of questions coming in but nothing going back out:

[dev] [mav@maverick-nano /etc/avahi]$ sudo tcpdump udp port 5353
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
21:18:14.731287 IP 192.168.5.143.mdns > 224.0.0.251.mdns: 0 [6a] [2q] PTR (QM)? _spotify-connect._tcp.local. PTR (QM)? _services._dns-sd._udp.local. (212)
21:18:14.743886 IP 192.168.5.157.mdns > 224.0.0.251.mdns: 0*- [0q] 2/0/3 PTR 598e26a01a82b469-0._spotify-connect._tcp.local., PTR _spotify-connect._tcp.local. (209)
21:18:14.746042 IP 192.168.5.81.mdns > 224.0.0.251.mdns: 0*- [0q] 5/0/0 PTR 598e26a01a82b469-0._spotify-connect._tcp.local., A 192.168.5.157, TXT "CPath=/zc/0" "VERSION=1.0" "Stack=SP", SRV 598e26a01a82b469-0.local.:53228 0 0, PTR _spotify-connect._tcp.local. (209)
21:18:14.746528 IP 192.168.5.157.mdns > 224.0.0.251.mdns: 0*- [0q] 2/0/4 PTR 598e26a01a82b469-0._spotify-connect._tcp.local., PTR _spotify-connect._tcp.local. (223)
21:18:14.773457 IP 192.168.5.157.mdns > 224.0.0.251.mdns: 0*- [0q] 1/0/0 PTR _spotify-connect._tcp.local. (76)
21:18:14.774613 IP 192.168.5.81.mdns > 224.0.0.251.mdns: 0*- [0q] 1/0/0 PTR _spotify-connect._tcp.local. (76)
21:18:15.743304 IP 192.168.5.157.mdns > 224.0.0.251.mdns: 0*- [0q] 2/0/3 PTR 598e26a01a82b469-0._spotify-connect._tcp.local., PTR _spotify-connect._tcp.local. (209)
21:18:15.745214 IP 192.168.5.81.mdns > 224.0.0.251.mdns: 0*- [0q] 5/0/0 PTR 598e26a01a82b469-0._spotify-connect._tcp.local., A 192.168.5.157, TXT "CPath=/zc/0" "VERSION=1.0" "Stack=SP", SRV 598e26a01a82b469-0.local.:53228 0 0, PTR _spotify-connect._tcp.local. (209)
21:18:16.385134 IP 192.168.5.102.mdns > 224.0.0.251.mdns: 0*- [0q] 1/0/1 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11" (169)
21:18:16.385313 IP6 fe80::18e1:b4d1:c2b5:4321.mdns > ff02::fb.mdns: 0*- [0q] 1/0/1 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11" (169)
21:18:16.386702 IP 192.168.5.81.mdns > 224.0.0.251.mdns: 0*- [0q] 2/0/0 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11", (Cache flush) NSEC (169)
21:18:16.386962 IP6 fe80::dea6:32ff:fe0a:583b.mdns > ff02::fb.mdns: 0*- [0q] 2/0/0 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11", (Cache flush) NSEC (169)
21:18:17.497766 IP 192.168.5.102.mdns > 224.0.0.251.mdns: 0*- [0q] 1/0/1 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11" (169)
21:18:17.497813 IP6 fe80::18e1:b4d1:c2b5:4321.mdns > ff02::fb.mdns: 0*- [0q] 1/0/1 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11" (169)
21:18:17.501133 IP 192.168.5.81.mdns > 224.0.0.251.mdns: 0*- [0q] 2/0/0 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11", (Cache flush) NSEC (169)
21:18:17.501269 IP6 fe80::dea6:32ff:fe0a:583b.mdns > ff02::fb.mdns: 0*- [0q] 2/0/0 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11", (Cache flush) NSEC (169)
21:18:19.529724 IP 192.168.5.102.mdns > 224.0.0.251.mdns: 0*- [0q] 1/0/1 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11" (169)
21:18:19.529791 IP6 fe80::18e1:b4d1:c2b5:4321.mdns > ff02::fb.mdns: 0*- [0q] 1/0/1 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11" (169)
21:18:19.531291 IP 192.168.5.81.mdns > 224.0.0.251.mdns: 0*- [0q] 2/0/0 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11", (Cache flush) NSEC (169)
21:18:19.531705 IP6 fe80::dea6:32ff:fe0a:583b.mdns > ff02::fb.mdns: 0*- [0q] 2/0/0 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11", (Cache flush) NSEC (169)
21:18:22.945156 IP maverick-nano.tendawifi.com.mdns > 224.0.0.251.mdns: 0 [1a] [4q] SRV (QM)? Maverick API._http._tcp.local. TXT (QM)? Maverick API._http._tcp.local. A (QM)? Maverick API._http._tcp.local. AAAA (QM)? Maverick API._http._tcp.local. (284)
21:18:22.946959 IP 192.168.5.81.mdns > 224.0.0.251.mdns: 0 [1a] [4q] SRV (QM)? Maverick API._http._tcp.local. AAAA (QM)? Maverick API._http._tcp.local. A (QM)? Maverick API._http._tcp.local. TXT (QM)? Maverick API._http._tcp.local. (284)
21:18:22.947383 IP 192.168.5.143.mdns > 224.0.0.251.mdns: 0 [1a] [4q] SRV (QM)? Maverick API._http._tcp.local. AAAA (QM)? Maverick API._http._tcp.local. A (QM)? Maverick API._http._tcp.local. TXT (QM)? Maverick API._http._tcp.local. (284)
21:18:22.947538 IP maverick-nano.tendawifi.com.mdns > 224.0.0.251.mdns: 0*- [0q] 1/0/1 (Cache flush) SRV maverick-api.local.:7000 0 0 (90)
21:18:22.949313 IP 192.168.5.81.mdns > 224.0.0.251.mdns: 0*- [0q] 2/0/0 (Cache flush) SRV maverick-api.local.:7000 0 0, (Cache flush) A 0.0.0.0 (90)
21:18:23.242863 IP 192.168.5.157.mdns > 224.0.0.251.mdns: 0*- [0q] 1/0/0 (Cache flush) A 192.168.5.157 (47)
21:18:23.244798 IP 192.168.5.81.mdns > 224.0.0.251.mdns: 0*- [0q] 1/0/0 (Cache flush) A 192.168.5.157 (47)
21:18:23.271793 IP 192.168.5.157.mdns > 224.0.0.251.mdns: 0*- [0q] 1/0/0 (Cache flush) A 192.168.5.157 (47)
21:18:23.274464 IP 192.168.5.157.mdns > 224.0.0.251.mdns: 0*- [0q] 1/0/0 (Cache flush) A 192.168.5.157 (47)
21:18:23.390146 IP 192.168.5.102.mdns > 224.0.0.251.mdns: 0*- [0q] 1/0/1 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11" (169)
21:18:23.390474 IP6 fe80::18e1:b4d1:c2b5:4321.mdns > ff02::fb.mdns: 0*- [0q] 1/0/1 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11" (169)
21:18:23.392281 IP 192.168.5.81.mdns > 224.0.0.251.mdns: 0*- [0q] 2/0/0 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11", (Cache flush) NSEC (169)
21:18:23.392668 IP6 fe80::dea6:32ff:fe0a:583b.mdns > ff02::fb.mdns: 0*- [0q] 2/0/0 (Cache flush) TXT "rpBA=2F:54:2B:70:13:38" "rpAD=d248e4d91e17" "rpFl=0x20000" "rpHN=c465448da9e9" "rpVr=190.11", (Cache flush) NS
fnoop commented 4 years ago

Add firewall entry for udp:5353, but also add parameter to be able to switch zeroconf off/block it, as it's an attack vector on an open network.

fnoop commented 4 years ago

Ah, maverick-nano doesn't have a sample node definition. Create one, as it should be separate from maverick-tegra. maverick_network module isn't included by default - it's included in the sample node defs, so avahi etc isn't being configured.

fnoop commented 4 years ago

Setting disallow-other-stacks=no in avahi-daemon.conf might allow us to also listen for mdns-sd requests from -api. Have to be careful that -api or other services don't start competing mdns answers.

fnoop commented 4 years ago

Also disabled avahi on loopback interfaces, and turned off the reflector. Having the reflector running on multiple devices on local network can /will lead to problems.

fnoop commented 4 years ago

mdns responses for maverick-nano.local now instant, and long lived.