· 7 years ago · Apr 14, 2018, 03:52 AM
1# This is just a note for myself.
2
3On EC2
4---
5yum install -y openvpn
6modprobe tun
7modprobe iptable_nat
8echo 1 > /proc/sys/net/ipv4/ip_forward
9iptables -t nat -A POSTROUTING -s 10.4.0.1/2 -o eth0 -j MASQUERADE
10openvpn --genkey --secret /mnt/secret.key
11cat /mnt/secret.key
12openvpn --proto udp --port 1194 --dev tun --ifconfig 10.4.0.1 10.4.0.2 --verb 1 --secret /mnt/secret.key --push "redirect-gateway def1" --push "dhcp-option DNS 172.16.0.23"
13
14On local box
15---
16mate Library/openvpn/openvpn.conf
17mate .secret.key