Skip to content

Instantly share code, notes, and snippets.

@corerman
Created January 10, 2018 14:02
Show Gist options
  • Save corerman/ae5aa50a0f98c70068d8351049431fe7 to your computer and use it in GitHub Desktop.
Save corerman/ae5aa50a0f98c70068d8351049431fe7 to your computer and use it in GitHub Desktop.
iptables转发:根据ip进行转发
iptables -t nat -A PREROUTING -d 1.2.3.4 -p tcp --dport 3389 -j DNAT --to 192.168.1.1:3389
类似这个的。
1.2.3.4是你的外网IP  192.168.1.1是你想映射到外网的内网服务器。
如果vps有多个ip,可以实现ip之间端口转发
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment