Skip to content

Instantly share code, notes, and snippets.

@hardenchant
Last active November 25, 2019 09:00
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 hardenchant/6f5487dee10f467be54e8f030de52bf7 to your computer and use it in GitHub Desktop.
Save hardenchant/6f5487dee10f467be54e8f030de52bf7 to your computer and use it in GitHub Desktop.
Working openvpn config

IPTABLES

Masquerade outgoing traffic

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE

Allow return traffic

iptables -A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -i tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT

Forward everything

iptables -A FORWARD -j ACCEPT

GUIDE LINK VPN SETTING

https://www.digitalocean.com/community/tutorials/openvpn-ubuntu-16-04-ru

SCRIPT FOR NGROK

#!/bin/sh
ngrok tcp -log stdout 22 > ~/ngrok.log &
ngrok tcp -config=/root/ngrok2.yml -log=stdout 1194 > ~/ngrok_vpn.log &

Here use two ngrok account, becouse they free. (only one conn per account is availible)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment