Skip to content

Instantly share code, notes, and snippets.

@ernado
Last active November 6, 2018 04:20
Show Gist options
  • Save ernado/5e06d137179e6b4253accaf342f9b901 to your computer and use it in GitHub Desktop.
Save ernado/5e06d137179e6b4253accaf342f9b901 to your computer and use it in GitHub Desktop.
Forward ports on Ubuntu with iptables
# Forward TCP 3389 on enp4s0 to 192.168.122.119
iptables -A PREROUTING -t nat -i enp4s0 -p tcp --dport 3389 -j DNAT --to 192.168.122.119:3389
iptables -I FORWARD 1 -d 192.168.122.119/32 -p tcp -m tcp --dport 3389 -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment