SUDO COMMANDS TO SET FIREWALL CONFIGURATIONS / PORT FORWARDING

PORT CHECKING

If you enter the command sudo ipfw list you will see the active commands. 

To reload the firewall issue the command sudo ipfw flushTo check to see if you have ipfw rules, you can always go to the terminal and type in: sudo ipfw list 

To delete a rule;-

sudo ipfw delete 7000  

(7000) being the rule number you wish to delete.


To add or remove ports listed

add a pot range:-

7000 is just a rule number, you can name the rule any number as long as it doesn't already exist. 

The port number range is in the format of 1234-1234

Single port add just 1234

TCP / UDP / GRE add the same rule , different rule number and change the TCP to the required protocol

sudo ipfw add 7000 allow tcp from any to any dst-port "?????-?????"
sudo ipfw add 1234 allow tcp from any to any dst-port "8080"
sudo ipfw add 7000 allow tcp from any to any dst-port portnum

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

SCREEN SHOT SHORTCUTS

ShortcutsCommand-Shift-3: Take a screenshot of the screen, and save it as a file on the...

STARTING IN SAFE MODE

To start up into Safe Mode (to Safe Boot), do this:Be sure your Mac is shut down.Press the power...

GOOD REFERENCE PAGES MAC

http://apple.stackexchange.comhttp://www.informit.comhttp://developernotes.com

SUDO COMMANDS / PORT FORWARDING EXAMPLE TERMINAL

COMMANDS ARE LISTED IN BOLD server:~ administrator$ sudo ipfw list01000 allow ip from any to...

WINDOWS 8 ON A MAC

HOW TO INSTALL WINDOWS 8 ON A MAC By Matt Smith — April 14, 2013 14...