FortiGateは GUI(Web管理画面) と CLI(コマンドライン) の両方で管理できます。
GUIは直感的ですが細かい制御には限界があり、CLIこそが全機能を扱うための中核です。
このCLIのすべてを体系化したものがFortiOS CLI Command Referenceであり、運用・トラブルシュート・自動化に必須の資料です。
CLIは大きく以下に分類されます。
config system global : FortiGate全体の設定(管理ポート、時刻、ログレベルなど)config system interface : ネットワークインターフェースの設定(IP、VLAN、zone)config router static : スタティックルート(IPv6は config router static6)config firewall policy : 通信制御ルールconfig firewall address : アドレスオブジェクトconfig firewall service custom : サービスオブジェクト作成config firewall service group : サービスグループ定義config vpn ipsec phase1-interface / phase2-interface : IPsec VPNconfig vpn ssl settings : SSL-VPN全体設定(待ち受けポートなど)config vpn ssl web portal : SSL-VPNポータル定義(ユーザー権限やUI制御)config user local : ローカルユーザーconfig user group : ユーザーグループ(AD/LDAP連携も可)show : 設定内容を表示get : ステータス情報を表示diagnose : 詳細診断・デバッグ
diagnose debug enable/disablediagnose debug application ike -1(IKEデバッグ全レベル出力)diagnose vpn ike log-filter dst-addr4 ...(FortiOS 7.4.0以前)diagnose vpn ike log filter rem-addr4 ...(7.4.1以降の新構文)diagnose sniffer packet any "host 8.8.8.8" 4 0 a(tcpdump相当)CLIは階層型構造をとります。
典型例
config firewall address
edit "Test-Host"
set subnet 192.168.1.10 255.255.255.255
next
end
ポイント
config で対象カテゴリに入るedit でオブジェクト作成/編集set でパラメータ指定next で保存&次の項目へend で終了get system performance statusget system interface physicaldiagnose hardware deviceinfo nic wan1diagnose debug reset diagnose vpn ike log filter rem-addr4 203.0.113.10 diagnose debug application ike -1 diagnose debug enable # 確認後は disable diagnose debug disablediagnose sniffer packet any "host 8.8.8.8" 4 0 a? コマンドで利用可能。 config system ? と入力すると、その階層で使えるコマンドが一覧表示されます。show full-configuration で非表示のデフォルト値を含めすべて確認可能。show 出力や設定バックアップを残すのが安全。FortiGateのコマンドリファレンスは、GUIでは設定できない詳細項目や障害対応を行う際に不可欠です。
特にVPN関連のデバッグ や パフォーマンス確認、サービス/ポリシーオブジェクトの定義が現場でよく使われます。
常に 利用中FortiOSのバージョンに合ったリファレンス を参照し、誤操作を避けるために ? やshow full-configuration を活用するのがベストです。
以上、FortiGateのコマンドリファレンスについてでした。
最後までお読みいただき、ありがとうございました。