<div dir="ltr"><div>Thanks Paul for looking into this issue and your valuable suggestion. <br></div><div>We can see that the same IP is getting retained after reboot as well. Let us  check our boot scripts.<br></div><div><br></div><div>Thanks,</div><div>Gayathri<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 8, 2023 at 9:44 PM Paul Wouters <<a href="mailto:paul@nohats.ca">paul@nohats.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, 8 Feb 2023, Gayathri Manoj wrote:<br>
<br>
> We have enabled  Pre-shared key based IPSec connection between our application  which running on linux environment and Router.  But when our system goes<br>
> for a reboot, we have to configure the policy again to work. Please let us know the reason for the same. Pasting the snippet of the secure log.<br>
<br>
> Feb  2 15:53:42.572620: added connection description "71528943210_psk"<br>
> Feb  2 15:53:42.572633: | 134.61.36.39<134.61.36.39>...134.61.36.55<134.61.36.55><br>
<br>
> Feb  2 15:53:42.583178: "71528943210_psk": We cannot identify ourselves with either end of this connection.  134.61.36.39 or 134.61.36.55 are not usable<br>
<br>
Odd. and you have the same IPs after a reboot?<br>
<br>
Looks like the network isn't full up yet when libreswan starts ?<br>
<br>
The linux distribution is responsible for ensuring the network is up<br>
before libreswan starts. A workaround might be to issue "ipsec whack --listen",<br>
assuming you do have auto=start for the connection, but how or where to<br>
add that to your startup service is up to you.<br>
<br>
The best thing is to fix that libreswan is started only after the IP<br>
is funcitonal at boot. Usually, this is systemd's responsibility and<br>
the /lib/systemd/system/ipsec.service file has an explicit:<br>
<br>
[Unit]<br>
Wants=network-online.target<br>
After=network-online.target<br>
<br>
That should only make it start after the network is fully online.<br>
<br>
Paul<br>
</blockquote></div>