Skip to content

Instantly share code, notes, and snippets.

@we4tech
Created May 4, 2020 02:07
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 we4tech/c8f71eaa83edc859d87042bae239bd54 to your computer and use it in GitHub Desktop.
Save we4tech/c8f71eaa83edc859d87042bae239bd54 to your computer and use it in GitHub Desktop.
Iptables to forward egress (outbound) request to another IP and port
##
# Redirect all outbound requests from port 80 to a specific IP and port.
#
iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination $DEST_SERVER:$DEST_PORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment