我正在尝试使用 StrongSwan 创建隧道。为此,我创建了两个 sh 文件,每个网关路由器一个。我在 sh 文件中所做的就是创建隧道、配置隧道并调用“ipsec restart”。然后我在各自的路由器上执行每个文件。
奇怪的是,如果我按顺序执行这些命令,每次都会成功。但是,如果我同时执行它们,所有内容都会重新配置并看起来正确,但隧道上没有连接。再次调用“ipsec restart”可以解决问题。
我的问题是,同时设置隧道的每一端是否本质上是坏事?同时为每一端重新启动 ipsec 是否会以某种方式扰乱连接?
谢谢!
附加信息:
我查看了系统日志以查找正常运行和失败的运行,并在失败的运行的输出中发现以下内容:
Dec 13 10:06:32 CORE charon: 14[KNL] unable to add policy 172.28.2.2/32 === 172.102.211.2/32 fwd
Dec 13 10:06:32 CORE charon: 14[IKE] unable to install IPsec policies (SPD) in kernel
Dec 13 10:06:32 CORE charon: 14[ENC] generating IKE_AUTH response 1 [ IDr AUTH N(AUTH_LFT) N(MOBIKE_SUP) N(ADD_4_ADDR) N(ADD_4_ADDR) N(ADD_4_ADDR) N(ADD_4_ADDR) N(TS_UNACCEPT) ]
Dec 13 10:06:32 CORE charon: 07[IKE] CHILD_SA bag-afb-rtr_eth1{1} established with SPIs cc8d2941_i cfe8ad47_o and TS 172.102.211.2/32 === 172.28.2.2/32
Dec 13 10:06:32 CORE charon: 07[IKE] received AUTH_LIFETIME of 10248s, scheduling reauthentication in 9708s
Dec 13 10:06:32 CORE charon: 07[IKE] peer supports MOBIKE
Dec 13 10:06:32 CORE charon: 14[NET] sending packet: from 172.102.211.2[4500] to 172.28.2.2[4500]
Dec 13 10:06:32 CORE charon: 09[NET] received packet: from 172.102.211.2[4500] to 172.28.2.2[4500]
Dec 13 10:06:32 CORE charon: 09[ENC] parsed IKE_AUTH response 1 [ IDr AUTH N(AUTH_LFT) N(MOBIKE_SUP) N(ADD_4_ADDR) N(ADD_4_ADDR) N(ADD_4_ADDR) N(ADD_4_ADDR) N(TS_UNACCEPT) ]
Dec 13 10:06:32 CORE charon: 09[IKE] authentication of '172.102.211.2' with pre-shared key successful
Dec 13 10:06:32 CORE charon: 09[IKE] IKE_SA crh-432nd-sipr-rtr_eth2[1] established between 172.28.2.2[172.28.2.2]...172.102.211.2[172.102.211.2]
Dec 13 10:06:32 CORE charon: 09[IKE] scheduling reauthentication in 10046s
Dec 13 10:06:32 CORE charon: 09[IKE] maximum IKE_SA lifetime 10586s
Dec 13 10:06:32 CORE charon: 09[IKE] received TS_UNACCEPTABLE notify, no CHILD_SA built
Dec 13 10:06:32 CORE charon: 09[IKE] received AUTH_LIFETIME of 9806s, scheduling reauthentication in 9266s
Dec 13 10:06:32 CORE charon: 09[IKE] peer supports MOBIKE
Dec 13 10:06:32 CORE dhclient: DHCPDISCOVER on eth3 to 255.255.255.255 port 67 interval 10
Dec 13 10:06:32 CORE charon: 00[DMN] signal of type SIGINT received. Shutting down
这似乎表明了它无法正常工作的原因。知道是什么原因造成的吗?