顺便也加入到/etc/rc.local中(exit之前)。
以上配置全部完毕后,可以通过ipsec verify命令检测ipsec运行是否正常。
如果出现Checking for IPsec support in kernel [FAILED],您可能未启动ipsec服务,通过/etc/init.d/ipsec start启动。
如果出现NETKEY: Testing XFRM related proc values [FAILED],您可能未修改网络策略。
如果出现Pluto listening for IKE on udp 500 [FAILED],您可能需要安装apt-get install lsof。
如果没有出现[FAILED]表示运行正常。
Ubuntu使用apt-get安装openswan一定会出现Two or more interfaces found, checking IP forwarding [FAILED]。
而且客户端无法连接,且在/var/log/auth日志中出现
ERROR: netlink XFRM_MSG_DELPOLICY response for flow eroute_connection delete included errno 2: No such file or directory
那么原因应该是apt-get到的openswan版本并不能在该Ubuntu上运行,建议去openswan的官网下载2.6.34版本手动编译安装。
或在此下载源码:ftp://ro:[email protected]/openswan_lilith.pro.tar.gz
(这实在非常恶心,因为源码编译安装不是谁都能完成的,注意必须把源码解压在/usr/src下并apt-get install libgmp3-dev,以及bison,flex等然后再编译安装)
L2TP将和PPTP一样使用/etc/ppp/chap-secrets作为帐户密码文件。
重启所有服务: