在 Ubuntu 机器上,我想知道是否有一种方法可以通过多个网络接口(interface)卡 (NIC) 将特定的 HTTP 请求路由到同一服务器 - 比如说视频提供商。
我听说过 link bonding ,但这似乎超出了应用程序代码的控制范围。可以使用 libcurl 来执行此任务吗?
我想我可以检查系统配置以检测多个 NIC,但是如何转换地址以便从特定接口(interface)读取它?
最佳答案
通常,传出接口(interface)取决于您的路由表。
卷发支持selecting the outgoing interface .
--interface <name>
Perform an operation using a specified interface. You can enter interface name, IP address or host name. An example could look like:
curl --interface eth0:1 http://www.netscape.com/
If this option is used several times, the last one will be used.
如果您想使用多个接口(interface)进行相同的操作(如您提到的文章中),您需要包
ifenslave-2.6
.谷歌列出了许多如何使用它的教程。
关于http - 如何使用 libcurl 通过多个 NIC 路由客户端 HTTP 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25358601/