Skip to content

Instantly share code, notes, and snippets.

@steshaw
Created May 25, 2020 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steshaw/4fb376d3ee6ccd866b19ff5ff2be9fa1 to your computer and use it in GitHub Desktop.
Save steshaw/4fb376d3ee6ccd866b19ff5ff2be9fa1 to your computer and use it in GitHub Desktop.
#! /bin/bash
# custom startup script for GCP (in metadata)
tailscale up --advertise-routes=10.0.0.0/8,172.16.0.0/24
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
echo 0 | sudo tee /proc/sys/net/ipv4/conf/tailscale0/rp_filter
iptables -t nat -A POSTROUTING -j MASQUERADE
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment