Did this blog help you solve a problem? Tip me with Bitcoins at: 17dQktcAmU4urXz7tGk2sbuiCqykm3WLs6

Monday, May 2, 2011

Port Forwarding (80 to 8080 for Tomcat) Using IPFW on Mac OSX

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!!!

5 comments:

CaptRepect said...

Thanks for this post!

Also make sure your web sharing is off in the sharing settings.

Anonymous said...

Thanks for this. Exactly what I needed to do...

Anonymous said...

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

Tim Molter said...

@Anon nope. sorry.

Anonymous said...

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.