Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Results 1 to 6 of 6
  1. #1
    Zeus is offline Registered User
    Join Date
    May 2001
    Location
    Italy
    Posts
    243
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PLEASE, Help me setting up mac os x firewall !!

    I' all,
    please help me 'cause i'm going grazy with that supid built in mac os x firewall (ipfw).
    Now, my mac is connected to the internet via a DSL line.
    This machine works as a router (with geeRoute) and this service appear to give me no problems,
    then, there is the ftpd, and sshd daemon active.

    Due to the fact that this mac is a router i 'd like to set up the firewall in this way.
    ALLOW any connection from MY ROUTER TO THE INTERNET
    DENY any coonection from THE INTERNET TO MY ROUTER
    ALLOW ftp connection from THE INTERNET TO MY ROUTER
    ALLOW ssh coonection from THE INTERNET to MY ROUTER
    DENY afpovertcp coonection from THE INTERNET TO MY ROUTER

    (this last rule because i access the ftp accounts via Apple Talk and NONE out of the lan must use this protocol to connect to my machine)

    I've tryed to do this using BrickHouse ... but it doesn't work (the 548 - afpovertcp - port remain opened and accept connection from the internet)

    here is reported the script made up by Brickhouse (it leave the 548 port open... very strange!!!)

    #################################################
    # Allow Loopback
    #################################################
    add 1000 allow ip from any to any via lo0

    #################################################
    # Allow packets from existing connections
    #################################################
    add 1002 allow tcp from any to any established
    add 1003 allow all from any to any frag

    #################################################
    # Allow Essential ICMP Traffic
    #################################################
    add 1004 allow icmp from any to any icmptype 3,4,11,12

    #################################################
    ## Rules for the ppp0 interface
    #################################################

    #################################################
    ## Allow DHCP/BOOTP
    #################################################
    add 3000 allow udp from any 67-68 to any 67-68 via ppp0

    #################################################
    ## Allow Broadcast (for DHCP, etc)
    #################################################
    add 3001 allow ip from any to 255.255.255.255 via ppp0

    #################################################
    ## Deny Source Routed Packets
    #################################################
    add 3002 unreach host log ip from any to any ipopt ssrr,lsrr via ppp0

    #################################################
    ## Allow Network Time (NTP)
    #################################################
    add 3003 allow udp from any 123 to any 1024-65535 via ppp0

    #################################################
    ## Allow All ICMP Packets
    #################################################
    add 3004 allow icmp from any to any via ppp0

    #################################################
    ## Allow FTP-Data port
    #################################################
    add 3005 allow tcp from any 20-21 to any 1024-65535 in via ppp0

    #################################################
    ## Allow DNS
    #################################################
    add 3006 allow udp from any 1024-65535 to any 53 out via ppp0
    add 3007 allow udp from any 53 to any 1024-65535 in via ppp0

    #################################################
    ## * * * User Filter Policies * * *
    #################################################

    #################################################
    ## File Transfer (FTP)
    #################################################
    add 3008 allow tcp from any to any 20-21 in via ppp0
    add 3008 allow tcp from any 20-21 to any out via ppp0

    #################################################
    ## Remote Login (SSH)
    #################################################
    add 3009 allow tcp from any to any 22 in via ppp0
    add 3009 allow tcp from any 22 to any out via ppp0

    #################################################
    ## AppleShare IP/iDisk
    #################################################
    add 3010 deny log tcp from any to any 548 in via ppp0


    #################################################
    ## * * * Default Filter Policies * * *
    #################################################

    #################################################
    ## Allow All Outgoing Services
    #################################################
    add 53011 allow all from any to any out via ppp0

    #################################################
    ## Deny All Incoming Services
    #################################################
    add 53012 deny log all from any to any in via ppp0
    Now, PLEASE, is there any one can help me do this by posting the step by step instruction to do this via terminal ???


    THANKS, THANKS, IN ADVANCE A MILLION !!!
    Zeus
    (filippo_zeus <at> tin <dot> it)
    ----------------
    iBook G4 1000, 768 Ram, 40 Gb
    (OSx 10.3.9 and OSx 10.4.2)

  2. #2
    xaqintosh's Avatar
    xaqintosh is offline Master of Reality
    Join Date
    Jun 2001
    Location
    In a dreamworld paralleling your earth in time and space...
    Posts
    1,834
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't know much terminal stuff, but look on versiontracker under firewall and they have lots of guis to do it easily
    —XAQ
    ||| iMac G4 | 15" LCD | 800mhz | 512 mb ram | 60 gig HD | Mac OS X 10.3.1 | Super-Drive |||

  3. #3
    theed is offline Registered User
    Join Date
    Dec 2000
    Location
    PA or MD, USA
    Posts
    722
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I don't think you want that

    I am thinking that what you say is not really what you want. You say that you want traffic out to the internet, but no traffic in. ... that would mean that you couldn't view web pages, as you would try to request them, and they answer would never be allowed back in.

    I think you might want to do something along these lines, and for an explanation, the man pages for ipfw and natd are pretty sweet.

    as root issue:
    natd -interface ppp0 -deny_incoming
    ipfw -f flush
    ipfw add divert natd all from any to any via ppp0
    - Beware the wrath of my apathy.

  4. #4
    Zeus is offline Registered User
    Join Date
    May 2001
    Location
    Italy
    Posts
    243
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Excuse me is i was not too comprensible... i'm speak english wery well (as you can see ;-))))

    I want to access to my router and ftp server (the same machine) from the local area network using Apple Share ... and then ... i want to deny all the ftp users (that have access from the internet) the Apple Share protocol.

    So i think i have to 'close' the 548 port from incoming connections.

    Is this correct ???

    Thanks
    Zeus
    (filippo_zeus <at> tin <dot> it)
    ----------------
    iBook G4 1000, 768 Ram, 40 Gb
    (OSx 10.3.9 and OSx 10.4.2)

  5. #5
    theed is offline Registered User
    Join Date
    Dec 2000
    Location
    PA or MD, USA
    Posts
    722
    Thanks
    0
    Thanked 0 Times in 0 Posts
    natd -interface ppp0 -deny_incoming
    ipfw -f flush
    ipfw add allow tcp from any to any 20-22 in
    ipfw add divert natd all from any to any via ppp0

    this allows incoming ftp and ssh connections on any interface (ethernet card or DSL)

    this will allow you to hold any connection that you initiate (natd) but will ignore any connection that you did not initiate (deny_incoming) if it goes through your DSL (ppp0)

    all internal traffic is allowed.

    this makes for a relatively tight, but fairly usable box. Unless you're running servers, running natd so that it denies all is a great solution to a LOT of hack in attempts.

    to JUST deny outside tcp connections to your appleshare stuff, you would just type:

    ipfw -f flush
    ipfw add deny tcp from any to any 548 in via ppp0
    - Beware the wrath of my apathy.

  6. #6
    Zeus is offline Registered User
    Join Date
    May 2001
    Location
    Italy
    Posts
    243
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It worked!!

    thanks a lot !!!
    Zeus
    (filippo_zeus <at> tin <dot> it)
    ----------------
    iBook G4 1000, 768 Ram, 40 Gb
    (OSx 10.3.9 and OSx 10.4.2)

 

 

Similar Threads

  1. A bit of nostalgia: A Salute to Mac OS X
    By simX in forum Apple News, Rumors & Discussion
    Replies: 31
    Last Post: March 24th, 2005, 06:45 AM
  2. HP Photosmart 1315 and USB Print Sharing
    By zwheeloc in forum Mac Classic System & Software
    Replies: 12
    Last Post: February 6th, 2003, 08:20 PM
  3. apps list
    By Mac Osxtopus in forum Mac OS X System & Mac Software
    Replies: 7
    Last Post: May 29th, 2002, 11:31 AM
  4. Apple: Forget XP, try the Mac
    By tagliatelle in forum Bob's Place
    Replies: 1
    Last Post: November 25th, 2001, 06:12 AM
  5. Netscape 6.1 Profile Transfer from Mac OS 9.2.1 to Mac OS X
    By chemistry_geek in forum Apple News, Rumors & Discussion
    Replies: 0
    Last Post: October 12th, 2001, 05:42 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •