Port Forwarding in Mac OSX Mavericks (Port 80 to 8080 and 443 to 8443)

Some issues when setting up Tomcat server (using SSL) in Eclipse - Mac OS environment is that, Mac limit the port usage permission below 1000 to only root. So Eclipse won't be able to run the tomcat server at port 80 or 443.

This issue can be solved by setting up port forwarding in your Mac OS. Let's open terminal and type something cool.

UPDATE: For Mac OSX Yosemite, please refer to Port Forwarding in Mac OS Yosemite.

Step 1

First, let's check is there any existing port forwarding

sudo ipfw show

On My Mac, only this line shown:

65535 0 0 allow ip from any to any

Which means no port forwarding rules for port 80 and 443 yet.

Step 2

Lets forward all request from port 80 to port 8080

sudo ipfw add 100 fwd,8080 tcp from any to any 80 in

Step 3

And forward 443 to 8443

sudo ipfw add 100 fwd,8443 tcp from any to any 443 in


And in case you want to clear all the port forwarding rules you have set:

sudo ipfw flush

That's all.
Please note, the rules will be reset when you reboot.