Zerotier in a container on CHR
Posted: Wed Oct 19, 2022 10:45 pm
You can run Zerotier in a container on CHR.
I've had success with this one:
https://github.com/zyclonite/zerotier-docker
Instead of using a seperate subnet for the veth interface needed for Docker I just added the veth interface to the existing bridge.
Probably not good practice but it works! Change IP, Bridge names, interface name and disk to suit:
Then shell into your container and join your Zerotier Network.
You can use the IP address of the Zerotier network as a gateway to the networks attached or accessible to your CHR or advertise it etc using the IP address of your veth interface as the gateway to your Zerotier Network.
I've had success with this one:
https://github.com/zyclonite/zerotier-docker
Instead of using a seperate subnet for the veth interface needed for Docker I just added the veth interface to the existing bridge.
Probably not good practice but it works! Change IP, Bridge names, interface name and disk to suit:
Code: Select all
/interface/veth/add name=veth1 address=10.13.0.2/24 gateway=10.13.0.1
/interface/bridge/port add bridge=bridge1 interface=veth1
/container/envs/add key=net name=zt value=host
/container/envs/add key=cap-add name=zt value=NET_ADMIN
/container/envs/add key=device name=zt value=/dev/net/tun
/container/config/set registry-url=https://registry-1.docker.io tmpdir=disk1/pull
/container/add remote-image=zyclonite/zerotier:latest interface=veth1 root-dir=disk1/zerotier envlist=zt
You can use the IP address of the Zerotier network as a gateway to the networks attached or accessible to your CHR or advertise it etc using the IP address of your veth interface as the gateway to your Zerotier Network.