Please help with Zerotier installation issue

Hello everyone,
I have written myself an installation script for zerotier for my server (Raspberry Pi 4 running RPi OS 64-bit) based on https://zerotier.atlassian.net/wiki/spaces/SD/pages/193134593/Bridge+your+ZeroTier+and+local+network+with+a+RaspberryPi

I used to run the remove for some packages which made the whole thing work. But that also breaks wifi.

Can someone help me figure out why

sudo apt remove --purge --auto-remove dhcpcd5 fake-hwclock ifupdown isc-dhcp-client isc-dhcp-common openresolv

makes the server work or which part of it is the key?

Any is there maybe a new solution that does not require the removal of thos components?

Thank you for our help!

The whole script (I remove the name of network):

#!/bin/bash

echo "Install zerotier (y/n)?"
echo "This script will kill wifi capabilities, so the RasPi will only work via Ethernet!"
read user_input
if [ "$user_input" = "y" ]; then
sudo apt-get install iptables-persistent
curl -s https://install.zerotier.com | sudo bash
sudo zerotier-cli join d5e111111

echo "Did you allow client to zerotier network (y/n)?"
read user_input
if [ "$user_input" = "y" ]; then
sudo zerotier-cli listnetworks
sudo zerotier-cli set d5e111111111 allowManaged=0

#sudo apt remove --purge --auto-remove dhcpcd5 fake-hwclock ifupdown isc-dhcp-client isc-dhcp-common openresolv

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 d5e1111111 allowManaged=0
cat << EOF | sudo tee /etc/systemd/network/25-bridge-br0.network
[Match]
Name=br0

[Network]
Address=192.168.0.2/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=ztw11111

[Network]
Bridge=br0
EOF

cat << EOF | sudo tee /etc/systemd/network/25-bridge-br0-eth0.network   
[Match]
Name=eth0 # might be en*

[Network]
Bridge=br0
EOF
sudo zerotier-cli set d5e51111111 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
fi

echo "Adjust iptables for Zerotier (y/n)?"
read user_input
if [ "$user_input" = "y" ]; then
sudo iptables -I DOCKER-USER -p all -i br0 -j ACCEPT
sudo iptables-save
echo "Please add the following lines to crontab. DO NOT USE SUDO!"
echo "0 0 * * * sudo iptables -I DOCKER-USER -p all -i br0 -j ACCEPT"
echo "@reboot sudo iptables -I DOCKER-USER -p all -i br0 -j ACCEPT"
fi
echo "Ready (y/n)?"
read user_input
if [ "$user_input" = "y" ]; then
sudo crontab -l
sudo crontab -e
fi
echo "Step complete"

echo "Reboot now (y/n)?"
read user_input
if [ "$user_input" = "y" ]; then
sudo reboot
fi
fi
type or paste code here

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.