加入收藏 | 设为首页 | 会员中心 | 我要投稿 衡阳站长网 (https://www.0734zz.cn/)- 数据集成、设备管理、备份、数据加密、智能搜索!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

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

发布时间:2021-05-23 05:45:05 所属栏目:Linux 来源:网络整理
导读:我正在尝试配置openvpn,以便只有来自某些进程的流量通过vpn,但这些进程可以连接到任何地方. 我试图通过让openvpn不做任何路由配置(–route-noexec)并让应用程序显式连接到tun接口(例如:curl –interface tun0’http://www.ipchicken.com’ ),但connect()似

我正在尝试配置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的帖子.

(编辑:衡阳站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读