How to do local port forwarding with iptables
So after much searching around, I found the answer uses iptables, setting up a NAT, and using the built-ins PREROUTING and OUTPUT. First, you must have port forwarding enabled: echo “1” > /proc/sys/net/ipv4/ip_forward Then you have to add the following rules to your iptables NAT table, using your own values for ${P_src} and ${P_target}: iptables … Read more