linux – 如何配置openvpn仅为绑定到tun接口的进程代理流量?

我正在尝试配置openvpn,以便只有来自某些进程的流量通过vpn,但这些进程可以连接到任何地方.

我试图通过让openvpn不做任何路由配置(–route-noexec)并让应用程序显式连接到tun接口(例如:curl –interface tun0’http://www.ipchicken.com’ ),但connect()似乎超时了.

为了使tun接口满意,我还需要做一些其他的步骤吗?

解决方法

路由nopull

http://openvpn.net/index.php/open-source/documentation/manuals/69-openvpn-21.html

When used with –client or –pull,accept options pushed by server EXCEPT for routes.
When used on the client,this option effectively bars the server from adding routes to the client’s routing table,however note that
this option still allows the server to set the TCP/IP properties of the client’s TUN/TAP interface.

因此,将route-nopull添加到OpenVPN配置文件中.我写了一篇关于如何使用OpenVPN VPN with cURL/PHP的帖子.

dawei

【声明】:邵阳站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。