For dealing with IPsec in Linux, the advised way is using Strongswan.
Strongswan has well supported Debian packages nowadays; there are also a lot of advance in protocols supported and security bugs fixed, so going backwards for 2.6 is frowned upon. (And that supposing you manage to make the rest of the components of your system work properly with a 2.6 kernel).
I advise not trying to follow old tutorials, contrary to the past, for instance nowadays in Debian 9, you pretty manage to setup an IPsec VPN + IKEv2 without having to resort to compile any component.
For an example, see Setting up a secure VPN with strongSwan on debian
PS. The compiled part in that link is dnsproxy, which is not entirely relevant to the IPsec discussion per se, it is more a setup for fighting DNS leaking, and Debian also has a package for it.