Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| coreprojects:pf [2005/10/19 05:31] – bang | coreprojects:pf [2025/10/25 17:09] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== PF ====== | ||
| + | //author: [[budi.ang | Budi Ang]]// | ||
| + | |||
| + | '' | ||
| + | |||
| + | ===== Aktivasi PF ===== | ||
| + | |||
| + | < | ||
| + | $ sudo echo " | ||
| + | $ sudo reboot | ||
| + | </ | ||
| + | |||
| + | atau | ||
| + | |||
| + | < | ||
| + | $ sudo pfctl -e | ||
| + | $ sudo ifconfig pflog0 up | ||
| + | </ | ||
| + | |||
| + | untuk menonaktifkan pf di gunakan perintah berikut | ||
| + | < | ||
| + | pfctl -d | ||
| + | </ | ||
| + | |||
| + | beberapa perintah pfctl yang sering digunakan | ||
| + | < | ||
| + | # pfctl -f / | ||
| + | # pfctl -nf / | ||
| + | # pfctl -Nf / | ||
| + | # pfctl -Rf / | ||
| + | |||
| + | # pfctl -sn Menampilkan rules NAT | ||
| + | # pfctl -sr Menampilkan rules filter | ||
| + | # pfctl -ss Menampilkan tables stat | ||
| + | # pfctl -sa Menampilkan semuanya yang bisa di tampilkan | ||
| + | </ | ||
| + | |||
| + | ===== Konsep Filtering di PF====== | ||
| + | |||
| + | < | ||
| + | dari PF host -> internet = out | ||
| + | |||
| + | dari internet -> PF host = in | ||
| + | </ | ||
| + | |||
| + | Mohon maaf jika tidak ada fitur '' | ||
| + | |||
| + | |||
| + | ==== Macro ==== | ||
| + | |||
| + | '' | ||
| + | |||
| + | Penggunaan '' | ||
| + | |||
| + | < | ||
| + | server_if = " | ||
| + | udp_port = "{ 53 123 }" | ||
| + | pass in on $server_if inet proto udp from any to any port $udp_port keep state | ||
| + | </ | ||
| + | |||
| + | Ruleset di atas di'' | ||
| + | |||
| + | < | ||
| + | pass in on fxp0 inet proto udp from any to any port 53 keep state | ||
| + | pass in on fxp0 inet proto udp from any to any port 123 keep state | ||
| + | </ | ||
| + | |||
| + | ==== Tables ==== | ||
| + | |||
| + | '' | ||
| + | |||
| + | < | ||
| + | table <iix> { 114.120.0.0/ | ||