Useful Commands for Managing Ipsec VPN Tunnels

IP Security Protocol (ipsec) allows us to define rules regarding the travel of packets on a network. Often Ipsec is used for crafting VPN tunnels. Here are some commands a network administrator would find handy when setting up or modifying a VPN structure.

#kill isakmpd which is responsible for encrypted/authenticated network traffic aka the VPN tunnels
pkill isakmpd
#start the isakmpd daemon
isakmpd -T -K
#load the ipsec configuration file using ipsec
ipsecctl -f /etc/ipsec.conf
# use the -n option to specify only to load ipsec rules if there are no errors
ipsecctl -n -f /etc/ipsec.conf
#check the ipsec flows and SAs. SAs are essentially the VPN tunnel
ipsecctl -s all