پیاف
PF یا پکت فیلتر که به صورت pf هم نوشته میشود، یک فایروال حالتمند است که تحت اجازه نامه BSD منتشر میشود. پیاف را میتوان با iptables، ipfw، ipfilter مقایسه کرد. پیاف توسط پروژه اپنبیاسدی توسعه داده میشود اما به سکوهای دیگری مانند فریبیاسدی، نتبیاسدی و ... هم پورت شده است. pf توسط دانیل هارتمیر نوشته شد. پیاف اولین بار در OpenBSD 3.0 ظاهر شد. در اصل پیاف به عنوان جایگزینی برای ipfilter نوشته شد و بعد از آماده شدن پیاف، ipfilter از درخت CVS اپنبیاسدی حذف شد. دلیل انجام این کار این بود که توسعه دهندگان اپنبیاسدی با اجازه نامه ipfilter مشکل داشتند.
سینتکس pf شباهت بسیاری به ipfilter دارد. البته تغییراتی در آن ایجاد شده تا خواندن آن واضح تر شود.
نمونه فایل پیکربندی [ویرایش]
قوانینی که پیاف بر اساس آنها بستهها را تصفیه میکند، در فایلی نوشته شده و پیاف این فوانین را از این فایل میخواند. این فایل به صورت پیشفرض در مسیر /etc/pf.conf قرار دارد و از چند بخش تشکیل میشود. یک نمونه از این فایل پیکربندی را در زیر میبینید. توضیحات با کاراکتر # مشخص میشوند.
## Macros # The internal interface (connected to the local network). int_if="xl0" ## Options # Set the default policy to return RSTs or ICMPs for blocked traffic. set block-policy return # Ignore the loopback interface entirely. set skip on lo0 ## Translation rules # NAT traffic on the interface in the default egress interface group (to # which the interface out of which the default route goes is assigned) from the # local network. match out on egress from $int_if:network to any nat-to (egress) ## Filtering rules # Default deny rule, with all blocked packets logged. block log all # Pass all traffic to and from the local network, using quick so that later # rules are not evaluated if a packet matches this. Some rulesets would restrict # local traffic much further. pass quick on $int_if all # Permit all traffic going out, keep state so that replies are automatically passed; # many rulesets would have many rules here, restricting traffic in and out on the # external (egress) interface. (keep state is not needed in the newest version of pf) pass out keep state
منابع [ویرایش]
http://en.wikipedia.org/wiki/PF_%28firewall%29
|
|||||||||||||||||
|
||||||||||||||