Overview: L2TP/IPsec is a secure vpn tunneling protocol that allows vpn client to securely access the local network from any place. Layer 2 Tunneling Protocol (L2TP) is a tunneling protocol that does not provide any encryption or confidentiality by itself, thats where IPSec comes together as it responsible to protect the tunneling session.
Platform: Ubuntu 14 64BIT
Step by step:
Step 1: Install openswan
#apt-get install openswan
Step 2: Configure openswan config file
Configuration file path = /etc#ipsec.conf and ipsec.secret
Step 3: Configure ipsec.conf
#ipsec setup --start
Step 6: Restart
#service ipsec restart
Step 7: Add "ucsavpn" tunnel
#ipsec auto --add ucsavpn
Step 8: Reload ipsec.config file
#ipsec auto --replace ucsavpn
Step 9: Listen and debug tunnel
#ipsec whack --listen
Step 10: Establish vpn tunnel
#ipsec whack --name ucsavpn --initiate
Step 11: Terminate vpn tunnel
#ipsec whack --name ucsavpn --terminate