IKE 实现提供了采用可变密钥长度的算法。所选的密钥长度是由站点安全性确定的。通常,密钥越长,提供的安全性就越高。
在此过程中,将生成 ASCII 格式的密钥。
以下过程使用系统名称 enigma 和 partym。请用您的系统名称替换名称 enigma 和 partym。
开始之前
您必须成为分配有 "Network IPsec Management"(网络 IPsec 管理)权限配置文件的管理员。有关更多信息,请参见在 Oracle Solaris 11.2 中确保用户和进程的安全 中的使用所指定的管理权限。
如果执行远程管理,请参见Example 7–1 和在 Oracle Solaris 11.2 中管理安全 Shell 访问 中的如何使用安全 Shell 远程管理 ZFS,了解进行安全的远程登录的说明。
您可以使用 /etc/inet/ike/config.sample 作为模板。
此文件中的规则和全局参数应该允许系统的 ipsecinit.conf 文件中的 IPsec 策略可以成功实施。以下 IKEv1 配置示例会与如何使用 IPsec 保护两台服务器之间的网络通信中的 ipsecinit.conf 示例配合使用。
### ike/config file on enigma, 192.168.116.16 ## Global parameters # ## Defaults that individual rules can override. p1_xform { auth_method preshared oakley_group 5 auth_alg sha encr_alg 3des } p2_pfs 2 # ## The rule to communicate with partym # Label must be unique { label "enigma-partym" local_addr 192.168.116.16 remote_addr 192.168.13.213 p1_xform { auth_method preshared oakley_group 5 auth_alg sha256 encr_alg aes } p2_pfs 5 }
### ike/config file on partym, 192.168.13.213 ## Global Parameters # p1_xform { auth_method preshared oakley_group 5 auth_alg sha encr_alg 3des } p2_pfs 2 ## The rule to communicate with enigma # Label must be unique { label "partym-enigma" local_addr 192.168.13.213 remote_addr 192.168.116.16 p1_xform { auth_method preshared oakley_group 5 auth_alg sha256 encr_alg aes } p2_pfs 5 }
# /usr/lib/inet/in.iked -c -f /etc/inet/ike/config
## ike.preshared on enigma, 192.168.116.16 #… { localidtype IP localid 192.168.116.16 remoteidtype IP remoteid 192.168.13.213 # The preshared key can also be represented in hex # as in 0xf47cb0f432e14480951095f82b # key "This is an ASCII Cqret phrAz, use str0ng p@ssword tekniques" }
## ike.preshared on partym, 192.168.13.213 #… { localidtype IP localid 192.168.13.213 remoteidtype IP remoteid 192.168.116.16 # The preshared key can also be represented in hex # as in 0xf47cb0f432e14480951095f82b key "This is an ASCII Cqret phrAz, use str0ng p@ssword tekniques" }
# svcadm enable ipsec/ike:default
如果 IKEv1 管理员要刷新预先共享的密钥,他们可以编辑对等方系统上的文件,然后重新启动 in.iked 守护进程。
首先,在两个子网中使用预先共享的密钥的每个系统上,管理员更改预先共享的密钥项。
# pfedit -s /etc/inet/secret/ike.preshared … { localidtype IP localid 192.168.116.0/24 remoteidtype IP remoteid 192.168.13.0/24 # The two subnet's shared passphrase for keying material key "LOooong key Th@t m^st Be Ch*angEd \'reguLarLy)" }
然后,管理员重新启动每个系统上的 IKEv1 服务。
有关 pfedit 命令的选项的信息,请参见 pfedit(1M) 手册页。
# svcadm enable ipsec/ike:default
接下来的步骤
如果建立 IPsec 策略未完成,请返回到 IPsec 过程以启用或刷新 IPsec 策略。有关保护 VPN 的 IPsec 策略的示例,请参见使用 IPsec 保护 VPN。有关 IPsec 策略的其他示例,请参见如何使用 IPsec 保护两台服务器之间的网络通信。