Hello everyone,
I am trying to setup Zerotier on my Raspberry Pi 4B.
It works flawlessly on my Android and Windows devices but not yet on my Linux RPi.
I wrote myself a small script to try and recreate my installation process and help find the problem. No luck so far.
I did not uninstall anything! So it is a basic Raspberry Pi OS which is up to date (fresh install).
Does anybody see what the problem is? Could the bridge be the problem? Or does zerotier on RPi require something else to work? Or something else you might see?
I want to access the server running zerotier as well as all devices behind it. This works from all other clients, so only the RPi is not stable. I am able to ping and connect to devices, but e.g. SFTP keeps disconnecting after a few KB and pings drop a lot of packages.
I am trying to also bridge the zerotier network to other devices using an AP, so don’t be surprised about my bridging attempt).
ping 192.168.0.101
PING 192.168.0.101 (192.168.0.101) 56(84) bytes of data.
64 bytes from 192.168.0.101: icmp_seq=1 ttl=64 time=200 ms
64 bytes from 192.168.0.101: icmp_seq=2 ttl=64 time=88.1 ms
64 bytes from 192.168.0.101: icmp_seq=3 ttl=64 time=127 ms
64 bytes from 192.168.0.101: icmp_seq=4 ttl=64 time=105 ms
64 bytes from 192.168.0.101: icmp_seq=5 ttl=64 time=88.0 ms
64 bytes from 192.168.0.101: icmp_seq=6 ttl=64 time=400 ms
64 bytes from 192.168.0.101: icmp_seq=20 ttl=64 time=469 ms
64 bytes from 192.168.0.101: icmp_seq=21 ttl=64 time=90.0 ms
64 bytes from 192.168.0.101: icmp_seq=22 ttl=64 time=97.6 ms
64 bytes from 192.168.0.101: icmp_seq=23 ttl=64 time=98.7 ms
64 bytes from 192.168.0.101: icmp_seq=24 ttl=64 time=88.0 ms
64 bytes from 192.168.0.101: icmp_seq=43 ttl=64 time=182 ms
64 bytes from 192.168.0.101: icmp_seq=44 ttl=64 time=83.6 ms
64 bytes from 192.168.0.101: icmp_seq=45 ttl=64 time=89.5 ms
64 bytes from 192.168.0.101: icmp_seq=46 ttl=64 time=79.8 ms
64 bytes from 192.168.0.101: icmp_seq=47 ttl=64 time=80.5 ms
64 bytes from 192.168.0.101: icmp_seq=48 ttl=64 time=86.1 ms
^C
--- 192.168.0.101 ping statistics ---
48 packets transmitted, 17 received, 64.5833% packet loss, time 48284ms
rtt min/avg/max/mdev = 79.836/144.246/468.522/111.682 ms
My current script:
#!/bin/bash
sudo apt-get install iptables-persistent
curl -s https://install.zerotier.com | sudo bash
sudo zerotier-cli join MYNETWORK
sudo zerotier-cli listnetworks
sudo zerotier-cli set MYNETWORK allowManaged=0
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf;
sudo systemctl enable systemd-networkd;
sudo systemctl enable systemd-resolved;
sudo systemctl enable systemd-timesyncd;
sudo zerotier-cli set MYNETWORK allowManaged=0
cat << EOF | sudo tee /etc/systemd/network/25-bridge-br0.network
[Match]
Name=br0
[Network]
Address=192.168.0.3/24
Gateway=192.168.0.1
DNS=192.168.0.1
EOF
cat << EOF | sudo tee /etc/systemd/network/br0.netdev
[NetDev]
Name=br0
Kind=bridge
EOF
cat << EOF | sudo tee /etc/systemd/network/25-bridge-br0-zt.network
[Match]
Name=ztwdjlnlsc
[Network]
Bridge=br0
EOF
cat << EOF | sudo tee /etc/systemd/network/25-bridge-br0-wlan1.network
[Match]
Name=wlan1
[Network]
Bridge=br0
EOF
sudo zerotier-cli set MYNETWORK allowManaged=0
sudo tail -n+0 /etc/systemd/network/*
sudo echo "0" > /proc/sys/net/bridge/bridge-nf-call-iptables
sudo iptables -A FORWARD -p all -i br0 -j ACCEPT
sudo iptables-save
sudo iptables-save > /etc/iptables/rules.v4
sudo ip6tables-save > /etc/iptables/rules.v6
sudo systemctl enable netfilter-persistent