Help with Port Blocking

Jump to First Reply
Posted:
in Genius Bar edited January 2014
Hi,

I hope this is a simple request!



I use the built-in firewall in OS X. I have stopped most traffic except a few specified ports.

I want to block a specific UDP port both in and out.

The Firewall GUI options give me no way to add a specific deny, just a specific allow.

How can I add a block to this UDP port using a command line thing?



I understand that I can issue ipfw commands but don't want them to prevent my existing rules from operating.





Cheers!



Robster

Comments

  • Reply 1 of 11
    http://www.macdevcenter.com/pub/a/ma..._firewall.html



    This might help



    type man IPFW in terminal
     0Likes 0Dislikes 0Informatives
  • Reply 2 of 11
    costiquecostique Posts: 1,084member
    BrickHouse is one of the best GUI utilities to configure ipfw.
     0Likes 0Dislikes 0Informatives
  • Reply 3 of 11
    I second the recommendation for BrickHouse.



    It's hands-down the best firewall interface for Mac OS X. I stand by it.
     0Likes 0Dislikes 0Informatives
  • Reply 4 of 11
    Same here Brad, I just wish there was a more intuitive log I hate maintaining that text file in /var/logs/



    What ever you do DO NOT get norton personall firewall. Its the devil.



    Symantic needs to sit down and read a good book about programming in OS X...
     0Likes 0Dislikes 0Informatives
  • Reply 5 of 11
    robsterrobster Posts: 256member
    Yeah I've tried Brickhouse, but it feels like the easy way out.

    I want to learn something from the process...
     0Likes 0Dislikes 0Informatives
  • Reply 6 of 11
    costiquecostique Posts: 1,084member
    Quote:

    Originally posted by robster

    Yeah I've tried Brickhouse, but it feels like the easy way out.

    I want to learn something from the process...




    The best UNIX way to learn anything about anything, process included, is man ipfw.
     0Likes 0Dislikes 0Informatives
  • Reply 7 of 11
    robsterrobster Posts: 256member
    Quote:

    Originally posted by costique

    The best UNIX way to learn anything about anything, process included, is man ipfw.



    usually i'd agree but the man pages read like they were written in a competiontion for information obscurity
     0Likes 0Dislikes 0Informatives
  • Reply 8 of 11
    http://www.macdevcenter.com/pub/a/m...x_firewall.html



    I did actually post this link for a reason.



    This explains everything about ipfw, step by step tutorial on Port blocking etc.



    Lockstar
     0Likes 0Dislikes 0Informatives
  • Reply 9 of 11
    robsterrobster Posts: 256member
    Quote:

    Originally posted by Lockstar

    http://www.macdevcenter.com/pub/a/m...x_firewall.html



    I did actually post this link for a reason.



    This explains everything about ipfw, step by step tutorial on Port blocking etc.



    Lockstar






    Hi LockStar

    I'm very grateful, sorry if I didn't sound like it! I read the article and followed some links and has a little play and go the following to work....



    03020 deny udp from any to any 2222 in

    03030 deny udp from any to any 2222 out
     0Likes 0Dislikes 0Informatives
  • Reply 10 of 11
    You could also learn by BrickHouse's example.



    When you use its GUI to set your rules, you can then simply switch from the regular "Quick" view to the "Expert" view to see all the textual firewall commands it is using. From there you find and see exactly what each of the filters' corresponding ipfw commands are.
     0Likes 0Dislikes 0Informatives
  • Reply 11 of 11
    robsterrobster Posts: 256member
    Quote:

    Originally posted by robster

    Hi LockStar

    I'm very grateful, sorry if I didn't sound like it! I read the article and followed some links and has a little play and go the following to work....



    03020 deny udp from any to any 2222 in

    03030 deny udp from any to any 2222 out






    wow I just noticed this blocks the port that Office uses to check for multiple installs of one serial number. what a coincedence
     0Likes 0Dislikes 0Informatives
Sign In or Register to comment.