I installed Mac OS X Mavericks (10.9), and I'm using Jetty to publish a web app. I type
sudo ipfw add 100 fwd 127.0.0.1,8080 tcp from any to any 80 in
(my hosts file has 127.0.0.1 abc.com
)
but Safari can't connect to abc.com. It worked in OS X 10.8 though. Why?
The port in use in Mac OS can be checked with the lsof command. lsof stands for list open files and is a command to check the list of open files in the system. If you look at the output result of the lsof command, you can see that the process with PID 27871 is using port 8080.
On a Mac computer (earlier than macOS 11 Big Sur) Type "Network Utility" in the search field and select Network Utility. Select Port Scan, enter an IP address or hostname in the text field, and specify a port range. Click Scan to begin the test. If a TCP port is open, it will be displayed here.
ipfw
has been deprecated since Mountain Lion but was not removed until Mavericks.
It's now using the ported pf
exclusively.
I wrote a quick guide to configure and setup pf for port forwarding in Mavericks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With