<div dir="ltr"><div>Hi,</div><div><br></div><div>I am trying to run strongSwan 5.5.2 with non-root privileges as per <a href="https://wiki.strongswan.org/projects/strongswan/wiki/ReducedPrivileges">https://wiki.strongswan.org/projects/strongswan/wiki/ReducedPrivileges</a> (i.e. configured it with —with-user=vpn --with-group=vpn)</div><div>My linux kernel version is: 4.4.0-81-generic #104-Ubuntu SMP Wed Jun 14 08:17:06 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux</div><div>I see that when charon is running as root in ps command output: vpn      13988  0.0  0.2 762140  6056 ?        Ssl  12:37   0:00 /usr/local/libexec/ipsec/charon --use-syslog</div><div>However it fails to succeed in IKE negotiation with the below log messages:</div><div><br></div><div>Jun 29 11:32:38 UB-SS-1604 charon: 12[IKE] establishing CHILD_SA rbvti2</div><div>Jun 29 11:32:38 UB-SS-1604 charon: 12[KNL] allocating SPI failed: Operation not permitted (1)</div><div>Jun 29 11:32:38 UB-SS-1604 charon: 12[KNL] unable to get SPI</div><div>Jun 29 11:32:38 UB-SS-1604 charon: 12[IKE] unable to allocate SPIs from kernel</div><div><br></div><div>I read <a href="https://wiki.strongswan.org/issues/996">https://wiki.strongswan.org/issues/996</a> and added CAP_NET_ADMIN capability to charon binary, but no luck after that:</div><div>root@UB-SS-1604:~# setcap cap_net_admin,cap_net_raw=ep /usr/local/libexec/ipsec/charon</div><div>root@UB-SS-1604:~# getcap /usr/local/libexec/ipsec/charon</div><div>/usr/local/libexec/ipsec/charon = cap_net_admin,cap_net_raw+ep</div><div>root@UB-SS-1604:~# ls -l /usr/local/libexec/ipsec/charon</div><div>-rwxr-xr-x 1 root root 113136 Jun 28 13:12 /usr/local/libexec/ipsec/charon</div><div>root@UB-SS-1604:~#</div><div><br></div><div>Any idea what else is missing and how can I debug it further to root cause the issue? </div><div><br></div><div>Thanks,</div><div>Sandesh</div></div>