linux - 如何在 curl 上指定 IP 地址?

标签 linux curl networking

我的服务器有 5 个不同的外部 IP(都有效)

我通过使用添加它们:

 ip addr add xx.xx.xx.xx/32 dev eth0
 ip addr add yy.yy.yy.yy/32 dev eth0
 ip addr add zz.zz.zz.zz/32 dev eth0

我应该如何 curl 来使用 zz.zz.zz.zz IP 地址?

最佳答案

你应该可以使用

curl --interface zz.zz.zz.zz http://example.com/

关于linux - 如何在 curl 上指定 IP 地址?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43398957/

相关文章:

当 Content-Type 存在时,C libcurl 返回 null Content-Type。

git - 如何通过github API在github中创建仓库?

linux - 如何将带有国家字符的Linux Python 3.4代码转换成windows中的可执行代码

C++ 可执行文件,sh 1 :not found

linux - 使用 grep 在同一文本行中搜索多个模式[由换行符分隔]

node.js - nodejs https#request 在相同的 curl 请求成功的地方失败

algorithm - 如何以编程方式证明 "Six Degrees of Separation"概念?

c# - 如何在 TCPListener 上阻止来自欧洲的所有连接

linux - Siege 启动错误 - 无法连接到套接字

java - 基于文件的进程间通信的 EOFException