diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..fc86edb --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,19 @@ +version: '3' + +services: + zerotierbridge: + container_name: zerotierbridge + build: + context: . + dockerfile: Dockerfile + args: + ARCH: arm64 + VERSION: 1.6.5 + restart: always + privileged: true + volumes: + - zt_config:/var/lib/zerotier-one + environment: + - ZT_NETWORK=3efa5cb78af73143 +volumes: + zt_config: \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index bd8f0fc..2c24fda 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -14,7 +14,7 @@ do sleep 1 done -echo "joining networks: $ZT_NETWORK" +#echo "joining networks: $ZT_NETWORK" echo "joining $ZT_NETWORK" @@ -23,18 +23,15 @@ do echo "joining $ZT_NETWORK failed; trying again in 1s" sleep 1 done +# Print Client Info +echo "$(zerotier-cli info)" - -### Set IPTables to allow NATting -echo "setting up NATting" -sysctl -w net.ipv4.ip_forward=1 +# Set IPTables to allow NATting +sysctl -w net.ipv4.ip_forward=1 > /dev/null PHY_IFACE=eth0; ZT_IFACE=$(ls /sys/class/net | grep ^zt) iptables -t nat -A POSTROUTING -o $PHY_IFACE -j MASQUERADE iptables -A FORWARD -i $PHY_IFACE -o $ZT_IFACE -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i $ZT_IFACE -o $PHY_IFACE -j ACCEPT -echo "iptables --list-rules" -echo "$(ip a)" - sleep infinity \ No newline at end of file