Go to main content

手册页部分 8:系统管理命令

退出打印视图

更新时间: 2022年7月27日 星期三
 
 

ipseckey(8)

名称

ipseckey - 手动处理 IPsec 安全关联数据库 (Security Association Database, 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_FLUSHSADB_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 时也如此。启用此标志时输出 X,而非实际的十六进制数字。

–s filename

–f 选项相反。如果为 filename 指定 '-',则输出转为标准输出。当前的所有 SA 表的快照将以 –f 选项可读的格式输出。输出将是一系列的 add 命令,但某些名称未使用。之所以发生这种情况,是因为一个名称可能通常表示多个地址。

–v

详细模式。列显正发送到 PF_KEY 套接字的消息,并列显生命周期的原始秒数值。

COMMANDS

add

Add an SA.由于该命令涉及加密材料的传送,因此不能从 shell 调用,以免密钥可在 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 类似,不能从 shell 调用该命令,因为使用 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 SA 的 spidest 扩展。

flush

删除指定 SA_TYPE 的所有 SA 或所有类型的所有 SA。

monitor

连续报告任何 PF_KEY 消息。该命令可使用 SADB_X_PROMISC 消息类型,使常规 PF_KEY 套接字不会接收的消息可以接收到。请参见 pf_key(4P)

passive_monitor

除了不使用 SADB_X_PROMISC 消息类型外,其他方面都与 monitor 类似。

pmonitor

passive_monitor 的同义词。

dump

将显示指定 SA 类型的所有 SA 或所有的 SA。由于该命令会生成大量的数据,因此不能保证所有的 SA 信息都能成功传送,甚至该命令可能无法完成。

save

是模拟 –s 选项的命令。提供该命令是为了对特定 SA 类型(例如 espah)创建快照。

help

列显命令的简短摘要。

SA_TYPE

all

指定所有已知的 SA 类型。该类型仅用于 flushdump 命令。其作用与在这些命令中不指定 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.扩展通常与值成对出现,但某些扩展在其后需要两个值。

spi number

指定 SA 的安全参数索引。adddeletegetupdate 命令需要该扩展。

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 包含重播窗口。该扩展由 addupdate 命令使用。

replay_value number

Specifies the replay value of the SA.该扩展由 addupdate 命令使用。

state string|number

Specifies the SA state, either by numeric value or by the strings “larval”, “mature”, “dying”, or “dead”.如果未指定,缺省值为 mature。该扩展由 addupdate 命令使用。

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”。如果 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 的一半(请参见下文)。该扩展由 addupdate 命令使用。

soft_bytes number
hard_bytes number

指定该 SA 可以保护的字节数。如果未提供该扩展,缺省值是零,这意味着基于所保护的字节数,SA 将不过期。该扩展由 addupdate 命令使用。

soft_addtime number
hard_addtime number

指定从 larval SA 添加或更新该 SA 后,该 SA 可以存在的秒数。更新 mature(成熟)SA 不会重置添加它时的初始时间。如果未提供该扩展,缺省值是零,这意味着基于 SA 在添加之后可存在的时间,SA 将不过期。该扩展由 addupdate 命令使用。

soft_usetime number
hard_usetime number

指定该 SA 在首次使用后可以存在的秒数。如果未提供该扩展,缺省值是零,这意味着基于 SA 在添加之后可存在的时间,SA 将不过期。该扩展由 addupdate 命令使用。

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 处理地址的方式类似。

如果指定了 dst6dstaddr6,仅使用名称可识别的 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-traversal IPsec 包的协议。以下是其他 NAT-traversal 参数 (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 指定验证密钥。将该密钥表示为十六进制数组成的字符串,并以可选 / 结尾,例如 123/12。位数从最高有效位开始倒计数。例如,要表示三个 '1' 位,正确的语法是字符串 “e/3”。对于多密钥算法,该字符串是串联的多个密钥。该扩展由 addupdate 命令使用。

encrkey hexstring

为该 SA 指定加密密钥。encrkey 的语法与 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.该扩展由 addupdate 命令使用。

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 指定源证书标识。该扩展由 addupdate 命令使用。

dstidtype type, value

为该 SA 指定目标证书标识。该扩展由 addupdate 命令使用

标签扩展用于在 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 的通信的网络路径的安全。在明文 telnetrlogin 会话中使用 ipseckey 存在风险。

    • 如果存在读取窗口事件的隐藏程序,甚至本地窗口也可能受到攻击。

  2. 文件是否能通过网络访问,或者是否完全公开(–f 选项)?

    • 挂载在网络中的文件可在读取时被对手发现。

    • 包含加密材料的完全公开文件同样存在风险。

  3. ipseckey 命令设计为由 manual-key smf(7) 服务进行管理。由于 smf(7) 日志文件是完全公开的文件,因此 ipseckey 不在这些日志文件中记录任何语法错误,因为这些错误可能包含机密信息。

    如果启用了 manual-key smf(7) 服务,发现语法错误时,该服务会进入维护模式。日志文件会指出存在语法错误,但不指出错误内容。

    管理员应从命令行使用 ipseckey –c filename 来找出错误原因。请参见“选项”部分。

如果您的源地址是可通过网络查找的主机,并且您的命名系统本身已泄密,使用的所有名称都将不可信任。

安全漏洞通常在于工具的不当应用,而不在于工具本身。管理员在使用 ipseckey 时务必小心谨慎。最安全的运行模式可能是在控制台或其他硬连接的 TTY 中运行。

有关此主题的其他信息,请参见 Matt Blaze 在 Bruce Schneier 编著的《Applied Cryptography: Protocols, Algorithms, and Source Code in C》中撰写的后记。

服务管理工具

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)

手动密钥服务以禁用状态交付。系统管理员必须先按本手册页中所述手动创建 IPsec 安全关联 (Security Association, SA),然后才能启用该服务。

策略服务以启用状态交付,但没有配置文件,因此,在起始状态下,数据包不受 IPsec 保护。创建配置文件 /etc/inet/ipsecinit.conf 和刷新服务(svcadm refresh,请参见下文)后,会应用该配置文件中包含的策略。如果该文件中存在错误,该服务会进入维护模式。See ipsecconf(8).

以禁用状态交付的服务之所以按该方式交付是因为:系统管理员必须先为其创建配置文件,然后才能启用这些服务。有关 ike 服务,请参见 ike.config(5)

有关 ike 服务,请参见 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 的信息

同样,获取有关 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

将两个链接在一起的 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 是单向的。要实现安全通信,需要在相反方向添加第二个 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 将两个 SA 链接为一对

以下命令将两个 SA 链接在一起作为一对:

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

文件

/etc/inet/secret/ipseckeys

引导时使用的缺省配置文件。有关更多信息,请参见“服务管理工具”和“安全”部分。

属性

有关下列属性的说明,请参见 attributes(7)

属性类型
属性值
可用性
system/network
接口稳定性
Committed(已确定)

另请参见

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.纽约:John Wiley & Sons 出版,1996 年。

诊断

ipseckey 命令解析配置文件并报告发现的任何错误。如果存在多个错误,ipseckey 会报告尽可能多的错误。

ipseckey 命令不会尝试使用存在语法错误的上述命令某个命令可能在语法上正确,但可能由于内核拒绝了发往 pf_key(4P) 的请求而生成错误。之所以发生这种情况,可能是因为密钥的长度无效或指定的算法不受支持。

如果配置文件中存在任何错误,ipseckey 会报告有效命令数目和解析的命令总数。

Parse error on line N.

如果以交互方式使用 ipseckey 会输出用法信息,此时会改为输出上述信息。通常前面有其他诊断信息。由于上述命令可以使用反斜杠字符分隔行,从而涵盖配置文件中的多个行,因此该消息并不总能指出配置文件中导致错误的具体行。

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

这是常规的参数无效错误。诊断代码和消息可提供有关哪个值不正确及其原因的更详细信息。

附注

尽管 ipseckey 的名称显示是其 IPsec 专用命令,但 ipseckey 实际上与 route(8) 类似,因为它是一个连接基于套接字的管理引擎的命令行接口。对于ipseckey,该引擎是 PF_KEYPF_KEY 最初是在美国海军研究实验室 (United States Naval Research Laboratory, NRL) 开发的。

要以手动加密方式确保计算机安全通信,所有通信方都必须添加 SA。如果希望两个节点实现安全通信,这两个节点都需要添加相应的 SA。

随着其他安全协议添加到 PF_KEY 中,以后也可以在其他名称下调用 ipseckey

该命令需要有 sys_ip_config 特权才能操作,可以在全局区域和独占 IP 区域中运行。可以通过 ipseckey 为全局区域设置安全关联,以保护系统中共享 IP 区域的通信。