Share on Facebook0Tweet about this on TwitterShare on Reddit0Share on Google+0Share on LinkedIn0Share on StumbleUpon0Buffer this pageEmail this to someonePrint this page

terminal Here we show how easy it is to set up port forwarding (80 to 8080) 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. The ipfw command is deprecated in OS X Mountain Lion and later, but it has not been removed from Mavericks. If you run man ipfw, a message will appear saying: This utility is DEPRECATED. Please use pfctl(8) instead. While you may want to do port forwarding with pfctl to future proof your solution, these instructions showing how to use ipfw to do port forwarding will still work on OS X Mavericks.

Step 1: View Current Firewall Rules

Step 2: Add Port Forwarding Rule (80 to 8080)

The default port that Tomcat runs on is 8080, so here we show the command to do port fowarding from port 80 to 8080 (Tomcat’s default port). Obviously, this works for other ports as well, and you’d just have to adjust the command accordingly.

This is a temporary change, and it will revert once you reboot. If you want to make it permanent, you can create a lauch deamon for it.

Optional Remove Rule

If you want to remove your firewall rules run:

Port Forwarding Using PFCTL (aka PF) on Mac OS X

The setup for pfctl is similar to ipfw. Github user kujon has created a nice guide to show how to set up port forwarding from port 80 to another port using pfctl.

Share on Facebook0Tweet about this on TwitterShare on Reddit0Share on Google+0Share on LinkedIn0Share on StumbleUpon0Buffer this pageEmail this to someonePrint this page

Related Posts

Subscribe To Our Newsletter

Join our low volume mailing list to receive the latest news and updates from our team.

Leave a Comment

Newsletter

Subscribe to our low-volume mailing list to receive important updates and announcements directly in your inbox.