14. IPsec の設定
14.34 トンネルインタフェース関連の設定
150 14.IPsec の設定
14.33.6 SA の削除
[ 書式 ] ipsec sa delete id
[ 設定値 ] ○id
●SA の ID
●all... すべての SA
[ 説明 ] 指定した SA を削除する。
SA の ID は自動的に付与され、show ipsec saコマンドで確認することができる。
14.34.4 トンネルバックアップの設定
[ 書式 ] tunnel backup none
tunnel backup interface ip_address
tunnel backup pp peer_num [switch-router=switch1] tunnel backup tunnel tunnel_num[switch-interface=switch2] no tunnel backup
[ 設定値 ] ○interface... LAN インタフェース名
○ip_address... バックアップ先のゲートウェイの IP アドレス
○peer_num... バックアップ先の相手先情報番号
○tunnel_num... トンネルインタフェース番号
○switch1... バックアップの受け側のルータを 2 台に分けるか否か
●on... 分ける
●off... 分けない
○switch2... LAN/PP インタフェースのバックアップにしたがってトンネルを作り直すか否か
●on... 作り直す
●off... 作り直さない
[ 説明 ] トンネルインタフェースに障害が発生したときにバックアップとして利用するインタフェースを指定する。
[ 初期値 ] none
switch1 = off switch2 = on
152 14.IPsec の設定
14.34.5 トンネルテンプレートの設定
[ 書式 ] tunnel template tunnel_num [tunnel_num ...]
no tunnel template
[ 設定値 ] ○tunnel_num... 適用するトンネルインタフェース番号もしくは適用するトンネルインタフェース番号の範 囲 ( 複数指定することが可能 )
[ 説明 ] 選択されているトンネルインタフェースの設定を、テンプレートとして他のトンネルインタフェースにも適用す
るかどうかを設定する。
選択されているトンネルインタフェースに対して設定したコマンドは、以下のパラメータがトンネルインタ フェース番号に等しい場合、これらのパラメータを適用先のトンネルインタフェース番号に置換した上で、適用 先のトンネルインタフェースにも設定する。
□ipsec sa policyコマンドにて設定される、ポリシー ID
□ipsecで始まるコマンドにて設定される、 セキュリティ・ゲートウェイの識別番号
なお、ipsec ike remote nameコマンドに関しては、コマンド適用の際、相手側セキュリティゲートウェイの 名前の末尾に、トンネルインタフェース番号を付加する。
選択されているトンネルインタフェース対して設定されているコマンドと同じコマンドが、適用先のトンネルイ ンタフェースに既に設定されている場合、適用先のトンネルインタフェースに設定されているコマンドを優先し て適用する。
テンプレートとなるトンネルインタフェースに設定することで、他のトンネルインタフェースにも展開して適用 されるコマンドの一覧は以下のとおりである。
□ipsec ikeで始まるコマンドのうち、パラメータに「セキュリティ・ゲートウェイの識別子」をとるもの
□ipsec auto refreshコマンド
( 引数の「セキュリティ・ゲートウェイの識別子」を省略しない場合のみ )
□ipsec tunnelコマンド
□ipsec sa policyコマンド
□tunnel enableコマンド
テンプレートの設定が、実際の設定にどのように反映されているかは、以下のコマンドを用いることで確認でき る。
# show config tunneltunnel_num expand
[ ノート ] 本コマンドはトンネルインタフェースが選択されている時にのみ使用できる。
[ 初期値 ] トンネルテンプレートは設定されていない
[ 設定例 ] ○ipsec sa policyコマンドについて tunnel select 1
tunnel template 2-3
ipsec sa policy 1 1 esp aes-cbc sha-hmac
上記のコマンドが設定されている時、以下のコマンドが自動的に有効となる。
ipsec sa policy 2 2 esp aes-cbc sha-hmac ipsec sa policy 3 3 esp aes-cbc sha-hmac
○ipsec ike... コマンドについて tunnel select 1
tunnel template 2-3
ipsec ike local address 1 192.168.0.1
上記のコマンドが設定されている時、以下のコマンドが自動的に有効となる。
ipsec ike local address 2 192.168.0.1 ipsec ike local address 3 192.168.0.1
○ipsec ike remote nameコマンドについて tunnel select 1
tunnel template 2-3 ipsec ike remote name 1 pc
上記のコマンドが設定されている時、以下のコマンドが自動的に有効となる。
ipsec ike remote name 2 pc2 ipsec ike remote name 3 pc3
○トンネルインタフェース番号の指定について
適用するトンネルインタフェース番号は、番号の指定と範囲の指定を同時に記述することが可能である。
# tunnel template 2 4-100
# tunnel template 100 200-300 400
○以下の 2 つの設定例は同じ内容を示している。
( 設定例 1) tunnel select 1
ipsec tunnel 1
ipsec sa policy 1 1 esp aes-cbc sha-hmac ipsec ike encryption 1 aes-cbc
ipsec ike group 1 modp1024
ipsec ike local address 1 192.168.0.1 ipsec ike pre-shared-key 1 text himitsu1 ipsec ike remote address 1 any
ipsec ike remote name 1 pc tunnel enable 1
tunnel select 2 ipsec tunnel 2
ipsec sa policy 2 2 esp aes-cbc sha-hmac ipsec ike encryption 2 aes-cbc
ipsec ike group 2 modp1024
ipsec ike local address 2 192.168.0.1 ipsec ike pre-shared-key 2 text himitsu2 ipsec ike remote address 2 any
ipsec ike remote name 2 pc2 tunnel enable 2
( 設定例 2) tunnel select 1
tunnel template 2 ipsec tunnel 1
ipsec sa policy 1 1 esp aes-cbc sha-hmac ipsec ike encryption 1 aes-cbc
ipsec ike group 1 modp1024
ipsec ike local address 1 192.168.0.1 ipsec ike pre-shared-key 1 text himitsu1 ipsec ike remote address 1 any
ipsec ike remote name 1 pc tunnel enable 1
tunnel select 2
ipsec ike pre-shared-key 2 text himitsu2