Pluto实现总结

Pluto实现总结

1. ike默认使用的udp端口为500,如果激活了NAT-Traversal功能,就需要pluto监听udp4500端口

2. pluto支持在不同的操作系统使用不同的ip协议栈,默认使用--use-netkey,或者使用--use-klips, --use-mast,--use-bsdkame, --use-win2k or --use-nostack

3. pluto通过--nat_travesal来激活nat穿越,在nat路由器后的网段通过—virtual_private来进行设置

4. --force-keepalive将激活发送keep-alive包,防止ipsec-vpn链路间存在nat路由器,但没有ipsec流量后就关闭端口。--keep-alive设置发keep-alive包的间隔

5. pluto支持X.509证书的使用,如果需要就可以发送证书来使用。通过NSS来发送x.509相关的数据,包括CAcerts, certs, CRLs and private keys。所有认证相关的处理通过利用NSS数据库来完成,所有的认证材料都存储在NSS数据库,存储在/etc/ipsec.d 或者通过—ipsecdir来指定。

6. pluto可以利用helper children来卸载加密操作,利用—nhelpers来实现。底层加密优化可另行查看如何卸载加密操作。

7. pluto配置—perpeerlog来输出每个连接的日志,--perpeerlogbase配置日志目录

8. 如果需要调查pluto存在的内存泄漏,就可以运行携带--leak-detective选项

9. 状态对象对应一个连接,有状态对象对应ISAKMP SA,有状态对象对应ipsec SA

whack总结

1.whack被用来控制运行的pluto进程,来对pluto进行执行各种操作,他通过UNIX domain socket来与pluto通信,属于pluto上层的管理程序。

2. The listen form tells pluto to start orstop listening on the public interfaces for IKE requests from peers

3. The initiate form tells pluto tonegotiate an SA corresponding to a connection

4. The terminate form tells pluto to removeall SAs corresponding to a connection, including those being negotiated

5. The status form displays the pluto'sinternal state

6. The shutdown form tells pluto to shutdown, deleting all SAs.

以上对应whact 的相关命令:--listen, --initiate,--terminate ,–status, --shutdown

--ctlbase path:the UNIX domain socket for talkingto pluto

--label string:adds the string to all errormessages generated by whack

--name connection-name:sets the name of the connection 代码用ipsec-con-site的id作为连接name

--debug-all来激活输出所有的调试信息。

具体见https://review.openstack.org/#/c/496991/

pluto &&whack命令使用

底层openswan创建ipsec vpn连接过程

openstack代码neutron_vpnaas/services/vpn/device_drivers/ipsec.py中的主要方法:

def start(self):
    """Start the process.

    Note: if there is not namespace yet,
    just do nothing, and wait next event.
    """
    if not self.namespace:
        return
    if not self._process_running():
        self._cleanup_control_files()

    virtual_private = self._virtual_privates()
    #start pluto IKE keying daemon
    cmd = [self.binary,
           'pluto',
           '--ctlbase', self.pid_path,
           '--ipsecdir', self.etc_dir,
           '--use-netkey',
           '--un
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值