All of the port forwarding examples I can find are for NAT, which is not what I want. We have an HTTP server application that only binds to 1 port at a time. However, we need to bind to an additional port to get around a silly corporate firewall. For example, if my http server is listening on 1234, how do we forward 4321 to this port also? The server is debian, and I believe we can use iptables to accomplish this.
Well, I guess it's simply to write a DNAT rule:
As it's in the prerouting chain it should work without interference from the routing. But it seems like an awfully complicated way to solve the problem.
Instead, why don't you simply tell your HTTP server to bind to both ports? As you are on Debian I assume you use Apache. Then it's just adding two Listen directives in the httpd.conf:
Note that serving the same content on both ports won't work, as you will have to change all URL's depending on the port the users are connecting on, or all links will be broken...