Install custom DERP on severs

Run DERP server on a server

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
DERP_HOST=derp.example.com
STUN_PORT=12345
DERP_PORT=12346

~/go/bin/derper \
-c ~/.derper.key \
-a :${DERP_PORT} -http-port -1 \
-stun-port ${STUN_PORT} \
-hostname ${DERP_HOST} \
--certmode manual \
-certdir ~/.acme.sh/${DERP_HOST} \
--verify-clients

echo "[Unit]
Description=Tailscale derp service
After=network.target

[Service]
ExecStart=/${USER}/go/bin/derper \
-c /${USER}/.derper.key \
-a :${DERP_PORT} -http-port -1 \
-stun-port ${STUN_PORT} \
-hostname ${DERP_HOST} \
--certmode manual \
-certdir ~/.acme.sh/${DERP_HOST} \
--verify-clients
Restart=always
User=${USER}

[Install]
WantedBy=multi-user.target" \
| sudo tee /etc/systemd/system/derp.service

Acknowledgements