
You can achieve more custom rules using different combinations of the Protocol and Port settings.

Make sure that Auto with exceptions is selected from the Filtering Mode drop-down menu and click Add.Click Finish to create your new rule, and then close the Firewall window to return to the main program window. Select Entire Internet to create a rule that will be applied everywhere so that your application will always be allowed. Next to Destination, select where your rule will be applied: to the entire Internet, to your local network, or to a specific subnet or IP address range.To create a rule to always allow the application, select TCP & UDP from the Protocol drop-down menu, select Both from the Ports drop-down menu and then select All from the Local Port and Remote Port drop-down menus.Select Allow from the Action drop-down menu, select Both from the Direction drop-down menu (you can also select In or Out to create a rule that only allows incoming or outgoing communications) and click Next.Type a name for your new rule in the Name field and click Next.You can create an exception for any application on your device. This example demonstrates creating a rule to allow all online communications for iTunes.

Select the application that you want to create an exception for and then click Select.Make sure that Auto with exceptions is selected from the Filtering Mode drop-down menu and click Add.
