CURL --interface not working: "Couldn't bind to ..." error

curl

Solution

Looks like there is a bug in Curl when using --interface if the domain requested is using both ipv4 and ipv6 instead of just ipv4 you have to add --ipv4 to work.

So thats the case with www.google.com, so to make it work would be:

curl --interface 41.141.41.23 --ipv4 http://www.google.com

Problem

I'm trying to use curl with another IP address from the ones available in the server but I get this error: ``` curl --interface 41.141.41.23 http://www.google.com ``` curl: (45) Couldn't bind to 41.141.41.23 (its just an example address) It only lets me do it with the main one and only by the interface name: ``` curl --interface eth0 http://www.google.com ``` I'm using: Ubuntu 12.04 curl 7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3

Original source

Related problems