Skip to content

Instantly share code, notes, and snippets.

@yuuichi-fujioka
Created January 28, 2015 07:39
Show Gist options
  • Save yuuichi-fujioka/d10eff2b2fb2ba69855f to your computer and use it in GitHub Desktop.
Save yuuichi-fujioka/d10eff2b2fb2ba69855f to your computer and use it in GitHub Desktop.
port forwarding with iptables in the same network segment.
*nat
:PREROUTING ACCEPT [1:60]
:INPUT ACCEPT [1:60]
:OUTPUT ACCEPT [8:635]
:POSTROUTING ACCEPT [8:635]
-A PREROUTING -p tcp --dport 10022 -d 192.168.0.100 -j DNAT --to-destination 192.168.0.142:22
-A POSTROUTING -j MASQUERADE
COMMIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment