forked from patte/fly-tailscale-exit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·30 lines (23 loc) · 1.03 KB
/
start.sh
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
#!/usr/bin/env sh
echo 'Starting up...'
# error: adding [-i tailscale0 -j MARK --set-mark 0x40000] in v4/filter/ts-forward: running [/sbin/iptables -t filter -A ts-forward -i tailscale0 -j MARK --set-mark 0x40000 --wait]: exit status 2: iptables v1.8.6 (legacy): unknown option "--set-mark"
modprobe xt_mark
echo 'net.ipv4.ip_forward = 1' | tee -a /etc/sysctl.conf
echo 'net.ipv6.conf.all.forwarding = 1' | tee -a /etc/sysctl.conf
sysctl -p /etc/sysctl.conf
#echo 'net.ipv6.conf.all.disable_policy = 1' | tee -a /etc/sysctl.conf
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/app/tailscaled \
--verbose=1 \
--port 41641 \
--state=mem: & # emphemeral-node mode (auto-remove)
#--tun=userspace-networking
#--socks5-server=localhost:1055
/app/tailscale up \
--authkey=${TAILSCALE_AUTH_KEY} \
--hostname=fly-${FLY_REGION} \
--advertise-exit-node #\
#--advertise-tags=tag:fly-exit # requires ACL tagOwners
echo "Tailscale started. Let's go!"
sleep infinity