zerotier-client:1.16.2 alpine镜像,支持amd64;arm64v8;arm32v7,以网关模式访问内网
4.1K
自用zerotier-client镜像,基础系统为alpine,支持amd64;arm64v8;arm32v7系统,可以设置为网关模式访问内网。
项目地址:https://github.com/DoTheBetter/docker/tree/master/zerotier-client
192.168.88.0 ,局域网 A 192.168.1.0 ,局域网 B 192.168.2.0echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sysctl -p
192.168.1.0/24 via 192.168.88.10
192.168.2.0/24 via 192.168.88.20

Allow Ethernet Bridging
下面是可用于自定义安装的可用选项的完整列表。
| 变量名 | 是否必须 | 默认值 | 说明 |
|---|---|---|---|
TZ | 可选 | Asia/Shanghai | 设置时区 |
GATEWAY_MODE | 可选 | true | 网关模式开关,true网关模式, false单机模式。 |
PHY_IFACES | 可选 | eth0 | 网关模式时使用:物理网卡名称,可为eth0, wlan0,eth0 wlan0三种类型。 |
IPTABLES_CMD | 可选 | iptables-legacy | 网关模式时使用:iptables版本:iptables-legacy、iptables-nft。部分宿主机命令不兼容时选择。 |
ZEROTIER_ONE_NETWORK_IDS | 必须 | 无 | ZeroTier 网络 ID,设置时自动连接到ZeroTier network,相当于命令zerotier-cli join $ZEROTIER_ONE_NETWORK_IDS |
| 范围 | 描述 |
|---|---|
host | 作为网关使用时,网络模式必须为host |
9993/udp | 单机模式 |
下面的目录用于配置,并且可以映射为持久存储。
| 目录 | 描述 |
|---|---|
/var/lib/zerotier-one | zerotier-one配置文件夹 |
本镜像在 docker hub,ghcr.io 及 aliyuncs同步推送,docker hub 不能使用时可使用其他仓库
# 网关模式
docker run -d \
--net host \
--name zerotier-client \
--restart always \
--device /dev/net/tun \
--cap-add NET_ADMIN \
--cap-add SYS_ADMIN \
--cap-add NET_RAW \
-e GATEWAY_MODE=true \
-e ZEROTIER_ONE_NETWORK_IDS=1234567890 \
-v /docker/zerotier-client:/var/lib/zerotier-one \
dothebetter/zerotier-client:latest
#ghcr.io/dothebetter/zerotier-client:latest
#registry.cn-hangzhou.aliyuncs.com/dothebetter/zerotier-client:latest
# 网关模式
version: '3'
services:
zerotier-client:
image: dothebetter/zerotier-client:latest
#ghcr.io/dothebetter/zerotier-client:latest
#registry.cn-hangzhou.aliyuncs.com/dothebetter/zerotier-client:latest
container_name: zerotier-client
restart: always
network_mode: host
devices:
- /dev/net/tun
cap_add:
- NET_ADMIN
- SYS_ADMIN
- NET_RAW
environment:
- GATEWAY_MODE=true
- ZEROTIER_ONE_NETWORK_IDS=1234567890
volumes:
- /docker/zerotier-client:/var/lib/zerotier-one
Content type
Image
Digest
sha256:f20045d2a…
Size
23.1 MB
Last updated
4 months ago
docker pull dothebetter/zerotier-client