added toggle nat added set depends on up being set
All checks were successful
Build and Push mikrotik-tailscale Container / build-and-push-arch (arm64) (push) Successful in 10s
Build and Push mikrotik-tailscale Container / build-and-push-arch (amd64) (push) Successful in -5s
Build and Push mikrotik-tailscale Container / merge-images-via-manifest (push) Successful in -10s
All checks were successful
Build and Push mikrotik-tailscale Container / build-and-push-arch (arm64) (push) Successful in 10s
Build and Push mikrotik-tailscale Container / build-and-push-arch (amd64) (push) Successful in -5s
Build and Push mikrotik-tailscale Container / merge-images-via-manifest (push) Successful in -10s
This commit is contained in:
parent
aef338d1f6
commit
fce015279f
1 changed files with 17 additions and 11 deletions
|
|
@ -7,22 +7,28 @@ echo "Setting Tailscale ARGS: $set"
|
|||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
|
||||
|
||||
# Try to enable NAT for Tailscale (may fail on MikroTik due to limited kernel modules)
|
||||
# This is optional for basic Tailscale functionality
|
||||
# if iptables -t nat -A POSTROUTING -o tailscale0 -j MASQUERADE 2>/dev/null; then
|
||||
# echo "NAT masquerading enabled"
|
||||
# else
|
||||
# echo "Warning: Could not enable NAT masquerading (kernel modules not available)"
|
||||
# echo "Tailscale will still work for basic connectivity"
|
||||
# fi
|
||||
|
||||
tailscale update --yes
|
||||
# Enable NAT masquerading if requested (nat=true|yes|1)
|
||||
case "${nat:-}" in
|
||||
true|yes|1)
|
||||
if iptables -t nat -A POSTROUTING -o tailscale0 -j MASQUERADE 2>/dev/null; then
|
||||
echo "NAT masquerading enabled"
|
||||
else
|
||||
echo "Warning: Could not enable NAT masquerading (kernel modules or iptables not available)"
|
||||
echo "Tailscale will still work for basic connectivity"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# nat not set to true/yes/1 — skip NAT setup
|
||||
;;
|
||||
esac
|
||||
|
||||
# Initialize and start Tailscale
|
||||
tailscaled > /dev/null 2>&1 &
|
||||
sleep 5
|
||||
tailscale up ${up}
|
||||
tailscale set ${set}
|
||||
if [ -n "${set}" ]; then
|
||||
tailscale set ${set}
|
||||
fi
|
||||
|
||||
while true; do
|
||||
tailscale netcheck
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue