Tuesday 1 March 2011

How to open and block ports in mac

This is my first post.
These commands are useful when you work on  your i-phone project in simulator for checking connection issues like blocking  a port in mac to check how you application will behave if network is unavailable to your app.

For blocking a port -
sudo ipfw add 9060 deny dst-port 5060 via en0

where 5060 is the port and 9060 is the id.

For unblocking a port -
 sudo ipfw del 9060

 where 9060 is the id you used to block port 5060.

No comments:

Post a Comment