Skip to content

Instantly share code, notes, and snippets.

@edgeboyo
Created March 4, 2020 23:10
Show Gist options
  • Save edgeboyo/23bde62c4181fd5b33a05bd1832a44fb to your computer and use it in GitHub Desktop.
Save edgeboyo/23bde62c4181fd5b33a05bd1832a44fb to your computer and use it in GitHub Desktop.
Script for OpenVPN port forwarding
if [ $# -ne 2 ]
then
echo "Usage: $(0) <port> <ip>"
fi
iptables -t nat -A PREROUTING -p tcp --dport $1 -j DNAT --to-destination $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment