大网数据广告活动
服务器运维问答

Restricting OpenVPN connection to only one program

· 52CE 我爱测

My Linux server works with YouTube videos a lot, downloading and collecting data about them with the help of youtube-dl . I want to route this program ( youtube-dl ) through an OpenVPN connection. Seems simple enough, except I ne…

问题原文

原帖链接 · pigeonburger · CC BY-SA 4.0

My Linux server works with YouTube videos a lot, downloading and collecting data about them with the help of youtube-dl.

I want to route this program (youtube-dl) through an OpenVPN connection. Seems simple enough, except I need only youtube-dl to use the VPN connection, as I also run a web server among other things which cannot use the VPN connection.

How can I configure my server to only use the OpenVPN connection for youtube-dl?

Without a separate VM.

已采纳解答

原帖链接 · pigeonburger · CC BY-SA 4.0

I forgot I asked this question, but I may as well leave the solution I ended up using here:

You can use a program called Vopono that works by creating temporary network namespaces.

It supports the Wireguard, OpenVPN, OpenConnect and OpenFortiVPN protocols, and can also be used out-of-the-box directly with many VPNs such as PIA and NordVPN as well, if that suits your needs.

Example usage with an OpenVPN configuration file:

vopono exec --custom vpn_config.ovpn --protocol openvpn "youtube-dl https://www.youtube.com/watch?v=dQw4w9WgXcQ"

No VM or anything like that needed!

More detailed usage info can be found here.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-04-03)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。