mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
Why: * Previously the terraform for all of the AWS infra was created and run outside of the mono repo. While this was very quick to setup and work with, keeping the gateway up to date was easy to forget about. Moving all of the AWS infra TF into the mono repo will allow everything to stay up to date and will make sure everyone has easy access to update any of the infra as needed. --------- Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
19 lines
502 B
Bash
19 lines
502 B
Bash
#!/bin/bash
|
|
|
|
set -xe
|
|
|
|
sudo apt-get update
|
|
|
|
# Enable IP forwarding
|
|
echo "net.ipv4.ip_forward = 1" | sudo tee -a /etc/sysctl.conf
|
|
sudo sysctl -p
|
|
|
|
# Setup iptables NAT
|
|
sudo iptables -t nat -A POSTROUTING -o ens5 -s 0.0.0.0/0 -j MASQUERADE
|
|
|
|
# Save iptables rules in case of reboot
|
|
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y iptables-persistent
|
|
sudo systemctl enable --now netfilter-persistent.service
|
|
sudo mkdir -p /etc/iptables
|
|
sudo /usr/bin/iptables-save | sudo tee -a /etc/iptables/rules.v4
|