【发布时间】:2014-10-11 02:07:53
【问题描述】:
在 Ubuntu 机器上,我想知道是否有办法通过多个网络接口卡 (NIC) 将特定的 HTTP 请求路由到同一台服务器 - 比如说视频提供商。 p>
我听说过link bonding,但这似乎超出了应用代码的控制范围。 libcurl 可以用来执行这个任务吗?
我想我可以检查系统配置以检测多个网卡,但是如何翻译地址以便从特定接口读取?
【问题讨论】:
在 Ubuntu 机器上,我想知道是否有办法通过多个网络接口卡 (NIC) 将特定的 HTTP 请求路由到同一台服务器 - 比如说视频提供商。 p>
我听说过link bonding,但这似乎超出了应用代码的控制范围。 libcurl 可以用来执行这个任务吗?
我想我可以检查系统配置以检测多个网卡,但是如何翻译地址以便从特定接口读取?
【问题讨论】:
通常,传出接口取决于您的路由表。
Curl 支持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.
如果你想为同一个操作使用多个接口(就像你提到的文章中的那样),你需要包ifenslave-2.6。谷歌列出了许多如何使用它的教程。
【讨论】: