Here I show how easy it is to set up port forwarding (80 to 8080 for Tomcat) on Mac OSX using ipfw from the Terminal. IPFW is the built-in firewall of Mac OSX and we can quickly set up a firewall rule to allow port forwarding...
Step 1: View current firewall rules.
sudo ipfw show
Step 2: Add port forwarding rule (80 to 8080 for Tomcat)
sudo ipfw add 100 fwd 127.0.0.1,8080 tcp from any to any 80 in
If you want to remove your firewall rules run:
sudo ipfw flush
Piece of Cake!!!
If you enjoyed this post, make sure you subscribe to the Obscured Clarity RSS feed to receive new posts in a reader or via email! Please consider clicking the Google [+1] button at the top of this post too!

5 comments:
Thanks for this post!
Also make sure your web sharing is off in the sharing settings.
Thanks for this. Exactly what I needed to do...
Any idea how to do the same with PF?
I'd like to forward all http traffic to port 8080 on a another(Proxy) machine.
Richard
@Anon nope. sorry.
I tried ipfw to forward 80 to 8080 at mydomain.com also, but no cigar.
Here's the command:
ipfw add 100 fwd mydomain.com,8080 tcp from any to any 80 in.
Post a Comment