本レシピでは、エッジゲートウェイを利用する際の一般的なフィルタリング設定例について説明します。
前提条件
- CLI の基本を理解している
参考)CLI の基本(『CLIユーザーズマニュアル』より)
対象機器
- AG10/20
- AR10/20(AR の場合は、br0 を eth1 に置き換えてください)
設定例
工場出荷時設定
インターフェース | Input | Output | Forward |
---|---|---|---|
ecm0 | 許可 | 許可 | 破棄 (Net BIOS, SMB) |
eth0 | 許可 | 許可 | 破棄 (Net BIOS, SMB) |
br0 | 許可 | 許可 | 破棄 (Net BIOS, SMB) |
ecm0 の Input を全て拒否して、その他は許可する設定
全インターフェースを Drop にしてから、lo(ローカル)、eth0、 br0 の Input を Accept することで ecm0 の Input を Drop とする。
インターフェース | Input | Output | Forward |
---|---|---|---|
ecm0 | 破棄 | 許可 | 破棄 (Net BIOS, SMB) |
eth0 | 許可 | 許可 | 破棄 (Net BIOS, SMB) |
br0 | 許可 | 許可 | 破棄 (Net BIOS, SMB) |
設定手順
STEP1:事前に許可をするインターフェースを設定する
lo(ローカル)、br0 (lan0-3)、 eth0 の Input を許可(Accept)する
amnimo(cfg)# filter input 20 ← インデックス番号を 20 と指定する
amnimo(cfg-fin-20)# match in-interface lo ← インデックス番号 20 はインターフェイス lo へ設定
You must fill in the following required fields:
policy
amnimo(cfg-fin-20)# policy accept
amnimo(cfg-fin-20)# enable
amnimo(cfg-fin-20)# exit
amnimo(cfg)# filter input 21 ← インデックス番号を 21 と指定する
amnimo(cfg-fin-21)# match in-interface eth0 ← インデックス番号 21 はインターフェイス eth0 へ設定
You must fill in the following required fields:
policy
amnimo(cfg-fin-21)# policy accept
amnimo(cfg-fin-21)# enable
amnimo(cfg-fin-21)# exit
amnimo(cfg)# filter input 22 ← インデックス番号を 22 と指定する
amnimo(cfg-fin-22)# match in-interface br0 ← インデックス番号 22 はインターフェイス br0 へ設定
You must fill in the following required fields:
policy
amnimo(cfg-fin-22)# policy accept
amnimo(cfg-fin-22)# enable
amnimo(cfg-fin-22)# exit
STEP2:接続済みの通信を許可、その後、SIM への接続を拒否する
- 接続済み通信を許可する
amnimo(cfg)# filter input 10
amnimo(cfg-fin-10)# match conntrack state related,established
You must fill in the following required fields:
policy
amnimo(cfg-fin-10)# policy accept
amnimo(cfg-fin-10)# enable
amnimo(cfg-fin-10)# exit - ecm0 への接続リクエストを拒否 (すべてのインターフェースを Drop に設定)
amnimo(cfg)# filter input default-policy drop
SIM (ecm0) の SSH 通信 (任意ポート) のみを許可する
ecm0 の Input が Drop となっている設定に、SSH 通信のみを Accept とする設定を追加する。
インターフェース | Input | Output | Forward |
---|---|---|---|
ecm0 |
SSH のみ 許可 |
許可 | 破棄 (Net BIOS, SMB) |
eth0 | 許可 | 許可 | 破棄 (Net BIOS, SMB) |
br0 | 許可 | 許可 | 破棄 (Net BIOS, SMB) |
設定手順
ecm0 の SSH 接続を許可する(任意のポート:45391)
amnimo(cfg)# filter input 122
amnimo(cfg-fin-122)# match conntrack state new
You must fill in the following required fields:
policy
amnimo(cfg-fin-122)# match protocol tcp flags syn,rst,ack,fin syn
amnimo(cfg-fin-122)# match protocol tcp dst-port 45391
amnimo(cfg-fin-122)# policy accept
amnimo(cfg-fin-122)# match in-interface ecm0
amnimo(cfg-fin-122)# enable
amnimo(cfg-fin-122)# exit
(補足)任意のポートで SSH 接続の待ち受けを設定する
SSH 待ち受けポートを任意のポート(例、45391) に設定する場合は、以下のように設定します。
amnimo(cfg)# ssh
amnimo(cfg-ssh)# show config
enable
port 22
keepalive
ciphers default
amnimo(cfg-ssh)# port 45391 ← 任意のポート
amnimo(cfg-ssh)# exit
コメント
0件のコメント
サインインしてコメントを残してください。