This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# linux firewall/forwarding | |
modprobe iptable_nat | |
echo 1 | tee /proc/sys/net/ipv4/ip_forward | |
iptables -t nat -A POSTROUTING -s 10.10.10.1/2 -o eth0 -j MASQUERADE | |
# install openvpn | |
apt-get update && apt-get install -y openvpn | |
cd /etc/openvpn/ | |
INSTANCE=$(curl http://169.254.169.254/latest/meta-data/public-hostname) | |
openvpn --genkey --secret ${INSTANCE}.key |