pfctlのコマンドを毎回忘れるのでメモ
サーバ
Published: 2022-07-07

いつもpfctlのコマンドを忘れるので一部をメモ。

ルール関連

  • 現在のルールを確認する
# pfctl -s rules
  • 統計値を見る場合は-vを付ける
# pfctl -vs rules

テーブル操作

  • テーブルリスト
# pfctl -s Tables
  • 統計値を見る場合は-vvを付ける
# pfctl -vvs Tables
  • テーブルのIPアドレスリストを表示
# pfctl -t <table> -T show
  • テーブルにIPアドレスを追加
# pfctl -t <table> -T add <IPAddress>
  • テーブルからIPアドレスを削除
# pfctl -t <table> -T delete <IPAddress>
  • テーブルのIPアドレスをすべて消す
# pfctl -t <table> -T flush