Skip to content

Instantly share code, notes, and snippets.

@riicchhaarrd
Created February 20, 2022 09:30
Show Gist options
  • Select an option

  • Save riicchhaarrd/76b68ff7e43e346a48bd6ed1020a4cdb to your computer and use it in GitHub Desktop.

Select an option

Save riicchhaarrd/76b68ff7e43e346a48bd6ed1020a4cdb to your computer and use it in GitHub Desktop.
iptables -t nat -I PREROUTING -p tcp -d 1.2.3.4 --dport 80 -j DNAT --to-destination 10.0.0.1:80
iptables -t nat -I PREROUTING -p tcp -d 1.2.3.4 --dport 22 -j DNAT --to-destination 10.0.0.2:22
iptables -I FORWARD -m state -d 10.0.0.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment