Go to main content

マニュアルページ セクション 8: システム管理コマンド

印刷ビューの終了

更新: 2022年7月27日
 
 

ipseckey(8)

名前

ipseckey - IPsec セキュリティーアソシエーションデータベース (SADB) の手動による操作

形式

ipseckey [-nvp]
ipseckey [-nvp] -f filename
ipseckey -c filename
ipseckey [-nvp] [delete | delete-pair | get] SA_TYPE {EXTENSION value...}
ipseckey [-np] [monitor | passive_monitor | pmonitor]
ipseckey [-nvp] flush [SA_TYPE]
ipseckey [-nvp] dump [SA_TYPE]
ipseckey [-nvp] save SA_TYPE {filename}
ipseckey [-nvp] -s filename

説明

ipseckey コマンドは、ネットワークセキュリティーサービス ipsecah(4P) および ipsecesp(4P) のセキュリティーアソシエーションデータベースを手動で操作するために使用されます。ipseckey コマンドを使用して、自動鍵管理が使用できない場合の通信者間のセキュリティーアソシエーションを設定できます。

ipseckey ユーティリティーの一般的なオプションの数は限られていますが、豊富なコマンド言語がサポートされています。ユーザーは、手動キーイング固有のプログラムインタフェースによって要求が配信されるように指定できます。pf_key(4P) を参照してください。ipseckey は、引数なしで呼び出されると対話型モードに入り、標準出力にプロンプトを出力したあと、ファイルの終わりに達するまで標準入力からコマンドを受け入れます。一部のコマンドは明示的なセキュリティーアソシエーション (「SA」) タイプを必要としますが、その他は SA タイプの指定を必要とせず、すべての SA タイプに対して機能します。

ipseckey では、PF_KEY ソケットと、メッセージタイプ SADB_ADDSADB_DELETESADB_GETSADB_UPDATESADB_FLUSH、および SADB_X_PROMISC を使用します。Thus, you must have the {PRIV_SYS_IP_CONFIG} privilege or Network IPSec Management rights profile to use this command.

ipseckey は機密性の高い暗号化キーイング情報を処理します。このコマンドを安全に使用する方法の詳細については、「セキュリティー」のセクションを参照してください。

オプション

–c filename

–f オプション (次を参照) と同様ですが、入力は実行されず、構文的に正しいかどうかの検査だけが行われる点が異なります。エラーは stderr に報告されます。このオプションは、変更を加えずに構成をデバッグするために用意されています。See SECURITY and “Service Management Facility” for more information.

–f filename

入力ファイル filename からコマンドを読み取ります。入力ファイルの行は、コマンド行言語と同じです。load コマンドは同様の機能を提供します。–s オプションまたは save コマンドにより、–f 引数で読み取り可能なファイルを生成できます。

–n

アクションの報告時に、ホスト名やネットワーク名をシンボルで出力できないようにします。これは、すべてのネームサーバーが停止したか、またはその他の理由で到達不能になった場合などに役立ちます。

–p

パラノイド。SA を保存する場合でもキーイング材料を一切出力しません。このフラグが有効になると、実際の 16 進数値の代わりに X を出力します。

–s filename

–f オプションの反対です。filename に「-」を指定すると、出力は標準出力に送られます。現在のすべての SA テーブルのスナップショットが、–f オプションで読み取り可能な形式で出力されます。出力は一連の add コマンドですが、使用されない名前が含まれています。これは、1 つの名前が複数のアドレスを示す場合があるために発生します。

–v

冗長。PF_KEY ソケットに送信されるメッセージを表示し、有効期間の生の秒数値を表示します。

COMMANDS

add

Add an SA.キーイング材料の転送を伴うため、ps(1) の出力に鍵が表示されないようにするために、シェルから呼び出すことはできません。It can be used either from the interactive ipseckey> prompt or in a command file specified by the –f command.add コマンドは、後述する拡張と値のペアをすべて受け入れます。

update

SA の有効期間を更新し、larval SA (中止された自動鍵管理からの残り) の場合はキーイング材料とその他の拡張を更新します。add と同様に、キーイング材料が ps(1) コマンドで表示されないようにするために、このコマンドをシェルから呼び出すことはできません。It can be used either from the interactive ipseckey> prompt or in a command file specified by the –f command.update コマンドは、拡張と値のペアをすべて受け入れますが、通常は SA の有効期間の更新のみに使用されます。

update-pair

As update, but apply the update to the SA and its paired SA, if there is one.

delete

特定の SADB から特定の SA を削除します。このコマンドには、IPsec SA の spi 拡張と dest 拡張が必要です。その他の拡張と値のペアは、削除メッセージには余分です。If the SA to be deleted is paired with another SA, the SA is deleted and the paired SA is updated to indicate that it is now unpaired.

delete-pair

特定の SADB から特定の SA を削除します。If the SA is paired with another SA, delete that SA too.This command requires the spi extension and the dest extension for the IPsec SA, or its pair.

get

特定の SADB からセキュリティーアソシエーションを検索して表示します。delete と同様に、このコマンドには IPsec の spidest だけが必要です。

flush

特定の SA_TYPE のすべての SA、またはすべてのタイプのすべての SA を削除します。

monitor

すべての PF_KEY メッセージについて継続的に報告します。これは SADB_X_PROMISC メッセージを使用して、通常の PF_KEY ソケットでは受信されないメッセージが受信されるようにします。pf_key(4P) を参照してください。

passive_monitor

monitor と同様ですが、SADB_X_PROMISC メッセージを使用しない点が異なります。

pmonitor

passive_monitor の同義語。

dump

特定の SA タイプのすべての SA、またはすべての SA を表示します。このコマンドでは大量のデータが生成されるため、すべての SA 情報が正常に提供される保証はなく、このコマンドが完了することさえも保証されません。

save

–s オプションと同様のコマンドです。たとえば espah など、特定の SA タイプのスナップショットを作成するためのコマンドとして含まれてます。

help

コマンドの簡単なサマリーを出力します。

SA_TYPE

all

すべての既知の SA タイプを指定します。このタイプは flush および dump コマンドにのみ使用されます。これは、これらのコマンドに SA タイプを指定しないことと同等です。

ah

IPsec 認証ヘッダー (「AH」) SA を指定します。

esp

IPsec カプセル化セキュリティーペイロード (「ESP」) SA を指定します。

EXTENSION VALUE TYPES

adddeletegetupdate などのコマンドには、特定の拡張および関連する値を指定する必要があります。ここでは、拡張、それらを使用するコマンド、およびそれらを必要とするコマンドの一覧を示します。現在、要件は SA の IPsec 定義に基づいて説明されています。Required extensions may change in the future. number can be in either hex (0xnnn), decimal (nnn) or octal (0nnn). string is a text string. hexstr is a long hexadecimal number with a bit-length.通常、拡張は値とペアになりますが、それらのあとに 2 つの値が必要な場合もあります。

spi number

SA のセキュリティーパラメータインデックスを指定します。この拡張は、adddeleteget、および update コマンドにのみ必要です。

pair-spi number

When pair-spi is used with the add or update commands, the SA being added or updated will be paired with the SA defined by pair-spi.A pair of SAs can be updated or deleted with a single command.

The two SAs that make up the pair need to be in opposite directions from the same pair of IP addresses.The command will fail if either of the SAs specified are already paired with another SA.

If the pair-spi token is used in a command and the SA defined by pair-spi does not exist, the command will fail.If the command was add and the pairing failed, the SA to be added will instead be removed.

inbound | outbound

These optional flags specify the direction of the SA.When the inbound or outbound flag is specified with the add command, the kernel will insert the new SA into the specified hash table for faster lookups.If the flag is omitted, the kernel will decide into which hash table to insert the new SA based on its knowledge the IP addresses specified with the src and dst extensions.

When these flags are used with the update, delete, update-pair, or get commands, the flags provide a hint as to the hash table in which the kernel should find the SA.

replay number

再実行ウィンドウサイズを指定します。指定されていない場合、再実行ウィンドウサイズはゼロと見なされます。手動で追加された SA が再実行ウィンドウを持つことは推奨されません。この拡張は add および update コマンドで使用されます。

replay_value number

Specifies the replay value of the SA.この拡張は add および update コマンドで使用されます。

state string|number

Specifies the SA state, either by numeric value or by the strings “larval”, “mature”, “dying”, or “dead”.指定のない場合、値はデフォルトの mature になります。この拡張は add および update コマンドで使用されます。

auth_alg string|number
authalg string|number

SA の認証アルゴリズムを、数値またはアルゴリズム名を示す文字列で指定します。現在の認証アルゴリズムには次のようなものがあります。

HMAC-SHA-1

shasha-1hmac-sha1hmac-sha

HMAC-SHA-256

sha256sha-256hmac-sha256hmac-sha-256

HMAC-SHA-384

sha384sha-384hmac-sha384hmac-sha-384

HMAC-SHA-512

sha512sha-512hmac-sha512hmac-sha-512

多くの場合、アルゴリズム名にはいくつかの同義語があります。この拡張は、特定の SA タイプの add コマンドに必要です。update コマンドでも使用されます。

認証アルゴリズムの完全なリストを取得するには、ipsecalgs(8) コマンドを使用してください。

encr_alg string|number
encralg string|number

Specifies the encryption algorithm for an SA, either by numeric value, or by strings indicating an algorithm name.Current encryption algorithms include Triple-DES (“3des”), AES (“aes”), and Camellia (“camellia”).この拡張は、特定の SA タイプの add コマンドに必要です。update コマンドでも使用されます。

暗号化アルゴリズムの完全なリストを取得するには、ipsecalgs(8) コマンドを使用してください。

次の 6 つの拡張は、有効期間の拡張です。「hard」と「soft」の 2 種類があります。hard 有効期間が期限切れになると、SA はシステムによって自動的に削除されます。soft 有効期間が期限切れになると、SADB_EXPIRE メッセージがシステムによって送信され、その状態は mature から dying にダウングレードされます。pf_key(4P) を参照してください。key に対する monitor コマンドを使用すると、SADB_EXPIRE メッセージを表示できます。

idle_addtime number
idle_usetime number

Specifies the number of seconds that this SA can exist if the SA is not used before the SA is revalidated.この拡張が存在しない場合、デフォルト値は hard_addtime の半分です (下記を参照)。この拡張は add および update コマンドで使用されます。

soft_bytes number
hard_bytes number

この SA が保護できるバイト数を指定します。この拡張が存在しない場合、デフォルト値はゼロで、保護されたバイト数に基づいて SA が期限切れにならないことを意味します。この拡張は add および update コマンドで使用されます。

soft_addtime number
hard_addtime number

追加後または larval SA からの更新後にこの SA が存在できる秒数を指定します。mature SA の更新では、追加されたときの初期時間はリセットされません。この拡張が存在しない場合、デフォルト値はゼロで、追加されてから存在している時間に基づいて SA が期限切れにならないことを意味します。この拡張は add および update コマンドで使用されます。

soft_usetime number
hard_usetime number

最初の使用後にこの SA が存在できる秒数を指定します。この拡張が存在しない場合、デフォルト値はゼロで、追加されてから存在している時間に基づいて SA が期限切れにならないことを意味します。この拡張は add および update コマンドで使用されます。

saddr address | name
srcaddr address | name
saddr6 IPv6 address
srcaddr6 IPv6 address
src address | name
src6 IPv6 address

srcaddr address and src address are synonyms that indicate the source address of the SA.指定されていない場合、発信元アドレスは未設定のままになるか、着信先アドレスが指定された場合はワイルドカードアドレスに設定されます。発信元アドレスを指定しないことは、IPsec SA では有効です。将来の SA タイプでは、この前提条件が変更される可能性があります。This extension is used by the add, update, get, and delete commands.

daddr address|name
dstaddr address|name
daddr6 IPv6 address|name
dstaddr6 IPv6 address|name
dst addr|name
dst6 IPv6 address|name

dstaddr addr and dst addr are synonyms that indicate the destination address of the SA.指定されていない場合、着信先アドレスは未設定のままになります。Because IPsec SAs require a specified destination address and spi for identification, this extension, with a specific value, is required for the add, update, get, and delete commands.

名前が指定された場合、ipseckey は、その名前で識別できるすべての着信先アドレスを持つ複数の SA に対してコマンドを呼び出そうとします。これは、ipsecconf がアドレスを処理する方法と似ています。

dst6 または dstaddr6 が指定された場合は、名前で識別される IPv6 アドレスだけが使用されます。

sport portnum

sport specifies the source port number for an SA.上位レイヤーのプロトコル (下記を参照) と組み合わせて使用すべきですが、必須ではありません。

dport portnum

dport specifies the destination port number for an SA.上位レイヤーのプロトコル (下記を参照) と組み合わせて使用すべきですが、必須ではありません。

encap protocol

NAT トラバーサル IPsec パケットのカプセル化に使用するプロトコルを指定します。その他の NAT トラバーサルパラメータ (nat_*) は下記のとおりです。The only acceptable value for protocol currently is udp.

proto protocol number
ulp protocol number

proto, and its synonym ulp, specify the IP protocol number of the SA.

nat_loc address|name

If the local address in the SA (source or destination) is behind a NAT, this extension indicates the NAT node's globally-routable address.nat_lport (下記を参照) が指定されている場合、このアドレスは SA のローカルアドレスと一致する可能性があります。

nat_rem address|name

If the remote address in the SA (source or destination) is behind a NAT, this extension indicates that node's internal (that is, behind-the-NAT) address.nat_rport (下記を参照) が指定されている場合、このアドレスは SA のローカルアドレスと一致する可能性があります。

nat_lport portnum

ESP のカプセル化が発生するローカル UDP ポートを指定します。

nat_rport portnum

ESP のカプセル化が発生するリモート UDP ポートを指定します。

isrc address | name[/prefix]
innersrc address | name[/prefix]
isrc6 address | name[/prefix]
innersrc6 address | name[/prefix]
proxyaddr address | name[/prefix]
proxy address | name[/prefix]

isrc and innersrc are synonyms.これらは、トンネルモード SA の内側の発信元アドレスを示します。

内側の発信元には、アドレスの代わりに接頭辞を指定できます。As with other address extensions, there are IPv6-specific forms to use only IPv6-specific addresses or prefixes.

以前のバージョンでは、この値はプロキシアドレスと呼ばれていました。非推奨ですが引き続き使用されます。

idst address | name[/prefix]
innerdst address | name[/prefix]
idst6 address | name[/prefix]
innerdst6 address | name[/prefix]

idst and innerdst are synonyms.They indicate the inner destination address for a tunnel-mode SA.

内側の着信先には、アドレスの代わりに接頭辞を指定できます。As with other address extensions, there are IPv6-specific forms to use only IPv6-specific addresses or prefixes.

innersport portnum
isport portnum

innersport specifies the source port number of the inner header for a tunnel-mode SA.上位レイヤーのプロトコル (下記を参照) と組み合わせて使用すべきですが、必須ではありません。

innerdport portnum
idport portnum

innerdport specifies the destination port number of the inner header for a tunnel-mode SA.上位レイヤーのプロトコル (下記を参照) と組み合わせて使用すべきですが、必須ではありません。

iproto protocol number
iulp protocol number

iproto, and its synonym iulp, specify the IP protocol number of the inner header of a tunnel-mode SA.

authkey hexstring

この SA の認証鍵を指定します。鍵は 16 進数字の文字列で表現され、オプションの / が末尾に付加され、たとえば 123/12 となります。ビット数は最上位ビットから下へカウントされます。たとえば、3 つの「1」ビットを表現するための正しい構文は文字列「e/3」です。複数鍵アルゴリズムの場合、文字列は複数の鍵を連結したものです。この拡張は add および update コマンドで使用されます。

encrkey hexstring

この SA の暗号化鍵を指定します。鍵の構文は authkey と同じです。A concrete example of a multi-key encryption algorithm is 3des, which would express itself as a 192-bit key, which is three 64-bit parity-included DES keys.この拡張は add および update コマンドで使用されます。

reserved_bits number

The last number bits of the encrkey string are marked as reserved in the PF_KEY message.このオプションは、特定の暗号化アルゴリズムのテスト専用です。

証明書アイデンティティーは、ほとんどの自動鍵管理プロトコルで使用される公開鍵証明書に SA を関連付けるため、自動鍵管理のコンテキストで非常に役立ちます。手動で追加された SA にはあまり役立ちません。Unlike other extensions, srcidtype takes two values, a type, and an actual value.使用できるタイプは、次のうちのいずれかです。

prefix

アドレスの接頭辞。

fqdn

完全修飾ドメイン名。

domain

ドメイン名。fqdn の同義語です。

user_fqdn

user@fqdn という形式のユーザーアイデンティティー。

mailbox

user_fqdn の同義語。

value は、証明書を識別できるような任意のテキスト文字列です。

srcidtype type, value

この SA の発信元証明書アイデンティティーを指定します。この拡張は add および update コマンドで使用されます。

dstidtype type, value

この SA の着信先証明書アイデンティティーを指定します。この拡張は add および update コマンドで使用されます。

ラベル拡張は、セキュリティーアソシエーションの内部で伝送されるトラフィックに機密ラベルを関連付けるために Trusted Extensions で使用されます。Trusted Extensions が有効になっていない場合、これらの拡張は許可されません。

label label

Defines the sensitivity label of traffic carried by this SA.Trusted Extensions を使用していないシステムでは許可されません。

outer-label label

この SA に属する暗号化テキストトラフィックの機密度を定義します。このラベルは外側のパケットヘッダーに表示されます。Trusted Extensions を使用していないシステムでは許可されません。この拡張を正しく使用しないと、ラベルポリシーの迂回を許す可能性があります。

implicit-label label

Defines the sensitivity of the ciphertext traffic belonging to this SA and request that this SA not contain an explicit on-the-wire label.Trusted Extensions を使用していないシステムでは許可されません。この拡張を正しく使用しないと、ラベルポリシーの迂回を許す可能性があります。

トンネルモード SA とトランスポートモード SA

An IPsec SA is a Tunnel Mode SA if the “proto” value is either 4 (ipip) or 41 (ipv6) and there is an inner-address or inner-port value specified.Otherwise, the SA is a Transport Mode SA.

セキュリティー

キーイング材料は機密性が高く、できるだけランダムに生成されるべきです。一部のアルゴリズムでは、弱い鍵が知られています。IPsec アルゴリズムには弱い鍵のチェックが組み込まれているため、新しく追加される SA に弱い鍵が含まれている場合、add コマンドは無効な値で失敗します。

ipseckey コマンドを使用すると、特権ユーザーが暗号化キーイング情報を入力できます。そのような情報に悪意のあるユーザーがアクセスできると、IPsec トラフィックのセキュリティーが損なわれます。ipseckey コマンドを使用する際には、次の問題を考慮するようにしてください。

  1. TTY の情報がネットワーク上を流れるか (対話モード)

    • そうである場合、キーイング材料のセキュリティーは、この TTY のトラフィックに対するネットワークパスのセキュリティーになります。平文の telnet または rlogin セッション経由で ipseckey を使用するのは危険です。

    • ウィンドウイベントを読み取ることのできる隠密プログラムが存在する場合、ローカルウィンドウでもその攻撃には無防備となります。

  2. ファイルがネットワーク経由でアクセスされたり、外部から読み取り可能であったりするか (–f オプション)

    • ネットワーク上にマウントされたファイルを読み取る際に、悪意のあるユーザーがその情報を盗む可能性があります。

    • 外部から読み取り可能なファイルにキーイング材料が格納されている場合も危険です。

  3. ipseckey コマンドは、manual-key smf(7) サービスで管理されるように設計されています。smf(7) のログファイルは外部から読み取り可能であり、また、構文エラーには秘密情報が含まれている可能性があるため、ipseckey はこれらのエラーをログファイルに記録しません。

    manual-key smf(7) サービスが有効になっているときに構文エラーが見つかった場合、サービスは保守モードに入ります。ログファイルには構文エラーが発生したことは示されますが、どのようなエラーであったかは示されません。

    管理者はコマンド行から ipseckey –c filename を使用して、エラーの原因を見つけるようにしてください。詳しくは「オプション」の項を参照してください。

送信元アドレスがネットワーク経由で検索可能なホストである場合に、ネームシステム自体の安全性が損なわれると、使用されているすべての名前が信用できなくなります。

セキュリティーの脆弱性はしばしば、ツール自体に原因があるのではなく、ツールの間違った適用方法に原因があります。管理者には、ipseckey コマンドの使用時に十分な注意を払うことを強くお勧めします。もっとも安全な操作モードはおそらく、コンソール上やその他の物理的に接続された TTY 上で作業を行うことです。

このテーマの追加情報については、Bruce Schneier 著『Applied Cryptography: Protocols, Algorithms, and Source Code in C』に含まれる Matt Blaze 氏の後書きを参照してください。

サービス管理機能

IPsec の手動鍵は、サービス管理機能 smf(7) によって管理されます。次に示すサービスは、IPsec のコンポーネントを管理します。これらのサービスは、次のように提供されます。

svc:/network/ipsec/policy:default (enabled)
svc:/network/ipsec/ipsecalgs:default (enabled)
svc:/network/ipsec/manual-key:default (disabled)
svc:/network/ipsec/ike:default (disabled)

manual-key サービスは無効な状態で提供されます。システム管理者は、そのサービスを有効にする前に、このマニュアルページの説明に従って手動 IPsec セキュリティーアソシエーション (SA) を作成する必要があります。

policy サービスは有効な状態で提供されますが、構成ファイルがないため、起動時の状態としてはパケットが IPsec で保護されません。構成ファイル /etc/inet/ipsecinit.conf を作成し、サービスをリフレッシュ (svcadm refresh、下記を参照) すると、構成ファイルに含まれているポリシーが適用されます。このファイルにエラーがある場合は、サービスが保守モードに入ります。See ipsecconf(8).

無効な状態で提供されるサービスは、有効にする前にシステム管理者がそれらの構成ファイルを作成する必要があるため、そのような方法で提供されます。ike サービスについては、ike.config(5) を参照してください。

ipsecalgs サービスについては、ipsecalgs(8) を参照してください。

正しい管理手順としては、各サービスの構成ファイルを作成してから、svcadm(8) を使用して各サービスを有効にします。

構成を変更する必要がある場合は、構成ファイルを編集してから、次のようにしてサービスをリフレッシュします。

example# svcadm refresh manual-key

Warning: To prevent ipseckey complaining about duplicate Associations, the ipseckey command flushes the Security Association Data Base (SADB) when the ipseckey command is run from smf(7), before adding any new Security Associations defined in the configuration file.This differs from the command line behavior where the SADB is not flushed before adding new Security Associations.

smf(7) フレームワークは、サービス固有のログファイルにエラーを記録します。logfile プロパティーを調べるには、次のいずれかのコマンドを使用します。

example# svcs -l manual-key
example# svcprop manual-key
example# svccfg -s manual-key listprop

manual-key サービスには、次のプロパティーが定義されます。

config/config_file

このプロパティーは、次の承認を割り当てられたユーザーが svccfg(8) を使用して変更できます。

solaris.smf.value.ipsec

auths(1), user_attr(5), rbac(7) を参照してください。

新しいプロパティーを有効にするには、svcadm(8) を使用してこのサービスをリフレッシュする必要があります。変更不可能な一般プロパティーは、svcprop(1) コマンドを使用して表示できます。

# svccfg -s ipsec/manual-key setprop config/config_file = \
    /new/config_file
# svcadm refresh manual-key

有効化、無効化、リフレッシュ、再起動要求など、このサービスに対する管理アクションは、svcadm(8) を使用して実行できます。次に示す承認を割り当てられたユーザーは、これらの操作を実行できます。

solaris.smf.manage.ipsec

サービスステータスを照会するには、svcs(1) コマンドを使用します。

ipseckey コマンドは、smf(7) 管理の下で実行されるように設計されています。ipsecconf コマンドはコマンド行から実行できますが、これは推奨されていません。ipseckey コマンドをコマンド行から実行する場合は、まず manual-key smf(7) サービスを無効にするようにしてください。See svcadm(8).

使用例 1 すべての SA を削除する

すべての SA を削除するには:

example# ipseckey flush
使用例 2 IPsec AH SA だけをフラッシュする

IPsec AH SA だけをフラッシュするには:

example# ipseckey flush ah
使用例 3 すべての SA を標準出力に保存する

すべての SA を標準出力に保存するには:

example# ipseckey save all
使用例 4 ESP SA をファイル /tmp/snapshot に保存する

ESP SA をファイル /tmp/snapshot に保存するには:

example# ipseckey save esp /tmp/snapshot
使用例 5 IPsec SA を削除する

IPsec SA を削除するには、SPI と着信先アドレスだけが必要です。

example# ipseckey delete esp spi 0x2112 dst 224.0.0.1

An alternative would be to delete the SA and the SAs pair if it has one:

example# ipseckey delete-pair esp spi 0x2112 dst 224.0.0.1
使用例 6 IPsec SA の情報を取得する

同様に、IPsec SA の情報を取得するには、着信先アドレスと SPI だけが必要です。

example# ipseckey get ah spi 0x5150 dst mypeer
使用例 7 IPsec SA を追加または更新する

SA を追加または更新するには、対話型モードに入る必要があります。

example# ipseckey
ipseckey> add ah spi 0x90125 src me.example.com dst you.example.com \
          authalg sha1 authkey
ipseckey> update ah spi 0x90125 dst you.example.com hard_bytes \
          16000000
ipseckey> exit

ペアとして相互にリンクされた 2 つの SA を追加するには:

example# ipseckey
ipseckey> add esp spi 0x2345 src me.example.com dst you.example.com \
   authalg sha1 d3b3be95dd3d688086d06c67c5e28482943142c9 \
   encralg aes encrkey be11a84eb75255e0d3add0c0cd9c5315
ipseckey> add esp spi 0x5432 src me.example.com dst you.example.com \
   authalg sha1 authkey d3b3be95dd3d688086d06c67c5e28482943142c9 \
   encralg aes encrkey be11a84eb75255e0d3add0c0cd9c5315 pair-spi
ipseckey> exit
使用例 8 反対方向の SA を追加する

IPsec の場合、SA は単方向です。安全に通信するには、2 つ目の SA を反対の方向に追加する必要があります。接続先のマシンも両方の SA を追加する必要があります。

example# ipseckey
ipseckey> add ah spi 0x2112 src you.example.com dst me.example.com \
          authalg sha1 authkey
 d3b3be95dd3d688086d06c67c5e28482943142c9 \
          hard_bytes 16000000 
ipseckey> exit
使用例 9 PF_KEY メッセージを監視する

PF_KEY メッセージの監視は簡単です。

example# ipseckey monitor
使用例 10 ファイル内のコマンドを使用する

–f オプションで解析できるファイルにコマンドを置くことができます。このファイルには、「#」記号で始まるコメント行を含めることができます。例:

# This is a sample file for flushing out the ESP table and
# adding a pair of SAs.

flush esp

### Watch out!  I have keying material in this file.  See the
### SECURITY section in this manual page for why this can be
### dangerous .

add esp spi 0x2112 src me.example.com dst you.example.com \
    authalg sha1 authkey d3b3be95dd3d688086d06c67c5e28482943142c9 \
    encralg aes encrkey be11a84eb75255e0d3add0c0cd9c5315 \
    hard_usetime 28800
add esp spi 0x5150 src you.example.com dst me.example.com \
    authalg sha1 authkey d3b3be95dd3d688086d06c67c5e28482943142c9 \
    encralg aes encrkey be11a84eb75255e0d3add0c0cd9c5315 \
    hard_usetime 28800

## End of file  -  This is a gratuitous comment
使用例 11 IPv6 アドレス用の SA を追加する

The following commands from the interactive-mode create an SA to protect IPv6 traffic between the site-local addresses

example # ipseckey
ipseckey> add esp spi 0x6789 \
     src6 fec0:bbbb::4483 dst6 fec0:bbbb::7843 \
     authalg sha1 authkey d3b3be95dd3d688086d06c67c5e28482943142c9 \
     encralg aes encrkey be11a84eb75255e0d3add0c0cd9c5315 \
     hard_usetime 28800
ipseckey> exit
使用例 12 2 つの SA をペアとしてリンクする

次のコマンドは、2 つの SA をペアとして相互にリンクします。

example# ipseckey update esp spi 0x123456 dst 192.168.99.2 \
pair-spi 0x654321

ファイル

/etc/inet/secret/ipseckeys

ブート時に使用されるデフォルトの構成ファイル。詳細は、「サービス管理機能」および「セキュリティー」を参照してください。

属性

属性についての詳細は、マニュアルページの attributes(7) を参照してください。

属性タイプ
属性値
使用条件
system/network
インタフェースの安定性
確実

関連項目

ps(1), svcprop(1), svcs(1), ipsec(4P), ipsecah(4P), ipsecesp(4P), pf_key(4P), ike.config(5), attributes(7), smf(7), ipsecalgs(8), ipsecconf(8), route(8), svcadm(8), svccfg(8)

Schneier, B. 著『Applied Cryptography: Protocols, Algorithms, and Source Code in C』、Second ed.New York, New York、John Wiley & Sons 発行、1996 年

診断

ipseckey コマンドは構成ファイルを解析し、すべてのエラーを報告します。複数のエラーがある場合、ipseckey はできるだけ多くを報告します。

ipseckey コマンドは、構文エラーのある COMMAND の使用を試みません。COMMAND が構文的に正しい場合でも、pf_key(4P) に対する要求をカーネルが拒否したためにエラーが生成されることがあります。これは、鍵の長さが無効だった場合や、サポートされていないアルゴリズムが指定された場合に発生することがあります。

構成ファイルにエラーがある場合、ipseckey は有効な COMMAND の数および解析された COMMAND の合計数を報告します。

Parse error on line N.

ipseckey を対話形式で使用すると使用法に関する情報が表示されるような場合には、代わりにこれが表示されます。通常、この前に別の診断が表示されます。構成ファイル内の COMMAND は、バックスラッシュ文字を使用して行を区切ることによって複数の行にわたる場合があるため、構成ファイル内でエラーの原因となった行を常に正確に特定できるとは限りません。

Unexpected end of command line.

コマンド行には追加の引数が必要でした。

Unknown

特定の拡張の値が不明でした。

Address type N not supported.

名前からのアドレスの検索で、サポートされていないアドレスファミリが返されました。

N is not a bit specifier
bit length N is too big for
string is not a hex string

キーイング材料が適切に入力されませんでした。

Can only specify single

重複する拡張が入力されました。

Don't use extension for string for command.

コマンドで使用されない拡張が使用されました。

One of the entered values is incorrect: Diagnostic code NN: msg

これは一般的な無効なパラメータエラーです。診断コードとメッセージは、どの値がなぜ正しくなかったかについて詳細を提供します。

IPsec 固有の名前を持っていますが、ipseckey はソケットベースの管理エンジン (この場合は PF_KEY) へのコマンド行インタフェースであるという点で、route(8) と同様です。PF_KEY は米国海軍研究所で最初に開発されました。

マシンが手動キーイングで安全に通信するためには、すべての通信者が SA を追加する必要があります。2 つのノードが安全に通信するには、両方のノードに適切な SA が追加されている必要があります。

将来、PF_KEY でほかのセキュリティープロトコルが使用可能になったら、ほかの名前でも ipseckey を呼び出すことができます。

このコマンドは、動作するために sys_ip_config 特権が必要であり、したがって大域ゾーンおよび排他的 IP ゾーンで実行できます。大域ゾーンで ipseckey を使用してセキュリティーアソシエーションを設定し、システム上の共有 IP ゾーンのトラフィックを保護することができます。