Skip to content

Instantly share code, notes, and snippets.

@jkullick
Created August 11, 2016 07:59
Show Gist options
  • Save jkullick/a7b1adae0a45caacc265bd9aeb608594 to your computer and use it in GitHub Desktop.
Save jkullick/a7b1adae0a45caacc265bd9aeb608594 to your computer and use it in GitHub Desktop.
Port Forwarding with IPtables
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport $PORT -j DNAT --to-destination $DEST_IP:$DEST_PORT
iptables -A FORWARD -p tcp -d $DEST_IP --dport $DEST_PORT -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment