First make sure you have done the following in the setting:


Assume we want to listen to port 12345, and forward it to internal ip with port 12345:

iptables -t nat -A PREROUTING -p tcp --dport 12345 -j DNAT --to-destination
iptables -t nat -A POSTROUTING -j MASQUERADE

For udp protocol, change the first line with udp instead of tcp.

You might want to save the iptables by:

  • level_4_tcp_udp_tunneling.txt
  • Last modified: 2020/03/20 00:41
  • by chongtin