# What are correct IPFW settings for SAMBA?



## jcs (Jan 30, 2022)

[_Mod: Split off from a ten year old thread_]



codeWarrior said:


> I hope this help you. Here's a copy my ipfw-rules.sh shell script.
> 
> 1) Save this as /usr/local/etc/ipfw-rules.sh
> 2) adjust the script according to your needs
> ...


hello,
I was struggling with the same issue as "J" above and found your posted solution through an internet search. I followed your example and it works perfectly. 
But, I have a followup question: do you/I still need to also specify the firewall type in the  /etc/rc.conf  ? e.g., `firewall_type="WORKSTATION"` client, simple,...etc. 
I tried your code with and without the firewall type specified and it works both ways, so I was wondering what you do in your  /etc/rc.conf ?
Thanks for your solution.


----------



## drr (Feb 8, 2022)

Based on my limited knowledge (I set up ipfw today with the help of Handbook and advise on the Forum), I think it may not be necessary to specify `firewall_type=` if you have your own rules script. The Handbook recommends loading the custom ruleset with `firewall_script=` command in /etc/rc.conf.

https://docs.freebsd.org/en/books/handbook/firewalls/#firewalls-ipfw


----------



## drr (Feb 8, 2022)

jcs said:


> I tried your code with and without the firewall type specified and it works both ways


This may be due to `ipfw -q -f flush` in the script file flushing out the list from the default ruleset?


----------

