[FreeBSD] FreeBSD - PF Firewall (3)
FreeBSD with Packet Filter(PF) Firewall - (3)
※ pfctl 的用法
pfctl 是可以直接控制 PF Firewall 的指令。
1. 啟用 PF
# pfctl -e
2. 停用 PF
# pfctl -d
3. 讀取/重讀 PF 設定檔
# pfctl -f /etc/pf.conf
- 僅重讀 PF 設定檔中的 Options 部份
# pfctl -f /etc/pf.conf -O
- 僅重讀 PF 設定檔中的 queue 部份
# pfctl -f /etc/pf.conf -A
- 僅重讀 PF 設定檔中的 NAT 部份
# pfctl -f /etc/pf.conf -N
- 僅重讀 PF 設定檔中的 filter rules
# pfctl -f /etc/pf.conf -R
4. 查看 PF 資訊
# pfctl -s info
# pfctl -s memory
# pfctl -s rules
# pfctl -vs rules
# pfctl -s nat
# pfctl -s queue
# pfctl -s all
5. 清除 PF 規則
# pfctl -F nat
# pfctl -F queue
# pfctl -F rules
# pfctl -F info
# pfctl -F Tables
# pfctl -F all
6. PF Tables 的使用
# pfctl -t table_name -T add spammers.org
# pfctl -t table_name -T delete spammers.org
# pfctl -t table_name -T flush
# pfctl -t table_name -T show
# pfctl -t table_name -T zero
--
\||||||/ 「一直到中古時期結束之前,理性代表具備一種心智,能夠看
q ^ ^ p 出各種事物之間精神層次的關聯、在主體與客體之間的律動
╰ 0 ╯ o 、微妙平衡或分配比率。 」
</ 菠 \-/ - Seven Life Lessons of Chaos
--
※ Origin: SayYA 資訊站 <bbs.sayya.org>
◆ From: 61-224-80-30.dynamic.hinet.net
FreeBSD 近期熱門文章
PTT數位生活區 即時熱門文章