Recently I switched from Comcast (Cable) to Speakeasy.net (DSL) so I could get static ips. After I got four static ips I found myself saying “Great, now what?”. Realizing quickly I had no idea how to route traffic from specific ips/ports I went on the hunt.
First I researched different firmware. I decided to use the DD-WRT firmware for my WRT150N router which gives telnet access has a web interface to update the firewall.
Next I found a good article on WRTrouters that illustrated how to route multiple ips through the firewall. There are a few things missing from the article, 1) POSTROUTING is not needed if you are just trying to route incoming traffic 2) Using PREROUTING for ips and ports is not covered, nor will the scripts in the article work for ports. With those two things said the article gave me a jumpstart on what to do. I needed to route ips and ports to different servers. The below is the script I came up with which works great for routing ip traffic for a specific port to another ip on a specific port. The nice thing is you can route traffic from one port to another port even though I’m not doing that. (The ips have been changed to protect the innocent.)
iptables -t nat -I PREROUTING -p tcp -d 57.63.155.40 --dport 21 -j DNAT --to-destination 68.100.241.60:21
iptables -t nat -I PREROUTING -p tcp -d 57.63.155.40 --dport 1723 -j DNAT --to-destination 68.100.241.60:1723
iptables -t nat -I PREROUTING -p tcp -d 57.63.155.40 --dport 80 -j DNAT --to-destination 68.100.241.62:80
iptables -t nat -I PREROUTING -p tcp -d 57.63.155.40 --dport 443 -j DNAT --to-destination 68.100.241.65:443
iptables -t nat -I PREROUTING -p tcp -d 57.63.155.41 --dport 80 -j DNAT --to-destination 68.100.241.60:80
No that I have the firmware and I have the firewall routing rules it is time to update the router. The DD-WRT control panel has a nice Commands tab under Administration.

On the Commands tab you can update the firewall rules by clicking on Save Firewall then click Edit. The Commands window will be populated with whatever is currently in the rc_firewall variable. Copy the above firewall updates into the Commands windows then click Save Firewall.

That is it, you should be routing traffic from multiple public ips using a cheap router.
*UPDATE*
I have found that trying to route using ports does not work as I expected thus the guidance provided by WRTrouters is a better way to proceed. My updated iptables script is as follows:
iptables -t nat -I POSTROUTING -p tcp -s 57.63.15.40 -j SNAT --to-source 68.100.241.62
iptables -t nat -I PREROUTING -p tcp -d 68.100.241.62 -j DNAT --to-destination 57.63.15.40
I will continue to research other ways of routing multiple wan ips | port combinations to enable greater configuration through the firewall, but for now this will get the job done.