大网数据广告活动
服务器运维问答

IPSec Tunnel goes down during long periods of inactivity

· 52CE 我爱测

I have 2 AWS regions I have connected using an OpenSWAN IPSec tunnel. This works great in our production environment but in our test environment where 1 of the regions has long periods of inactivity, the tunnel will go down and I…

问题原文

原帖链接 · Uberzen1 · CC BY-SA 3.0

I have 2 AWS regions I have connected using an OpenSWAN IPSec tunnel. This works great in our production environment but in our test environment where 1 of the regions has long periods of inactivity, the tunnel will go down and I have to SSH to the server and run sudo service network restart to get it running again.

I have seen vaguely alluded to elsewhere that by design IPSec will do this, but I can't see any hard and fast rules in any of the .conf files that specify any kind of tunnel timeout?

Is this just a feature of IPSec, can anyone point me to any OpenSWAN/IPSec documentation that explains this in depth as I can't find anything conclusive?

Also, based on this, is it best practice to have a cron job constantly pinging through the tunnel to keep it perpetually up?

Many Thanks,

已采纳解答

原帖链接 · FoamyBeer · CC BY-SA 3.0

Assuming you're using a setup similar to Openswan's ec2 example , try setting

lifetime=1800
rekey=yes 

but only on the initiating end. This will set SA expiry and renegotiate to every 30 minutes.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-02-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。