Mencoba memblokir lalu lintas masuk pada semua antarmuka ke port lokal tertentu pada Mac OS X 10.11.15, termasuk loopback.
Ini adalah /etc/pf.conf saya:
scrub-anchor "com.apple/*"
nat-anchor "com.apple/*"
rdr-anchor "com.apple/*"
dummynet-anchor "com.apple/*"
anchor "com.apple/*"
load anchor "com.apple" from "/etc/pf.anchors/com.apple"
block in quick to any port 63342
Namun, ketika mencoba menerapkan aturan ini, saya mendapatkan kesalahan (baris 29 adalah aturan blok):
✗ sudo pfctl -f /etc/pf.conf
pfctl: Use of -f option, could result in flushing of rules
present in the main ruleset added by the system at startup.
See /etc/pf.conf for further details.
No ALTQ support in kernel
ALTQ related functions disabled
/etc/pf.conf:29: port only applies to tcp/udp
/etc/pf.conf:29: skipping rule due to errors
/etc/pf.conf:29: rule expands to no valid combination
pfctl: Syntax error in config file: pf rules not loaded
Apa sintaks yang benar dalam kasus ini?