Forwarding ports on Linux.
After spending the better part of an hour trying to forward a port in Linux using iptables, here’s what you should do and what you should remember not to do.
This technique should work on any distro that has iptables, such as Ubuntu, Debian, Fedora, Red Hat, RHEL, Gentoo, etc. Here it is:
As a first step, enter the following rules in your iptables: