cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: is --interface or CURLOPT_INTERFACE bugged?

From: Bryan Schaefer <vega_12_at_yahoo.com>
Date: Mon, 28 Feb 2011 17:46:31 -0800 (PST)

Hi Dan,

Thanks for the reply. As I continued troubleshooting I discovered that routing
was not working in my environment, and I am studying iptables to figure it out.
I've got 6 ethernet devices (3 external, 1 dmz, 2 internal), and getting the
routing to work properly is proving tricky.

________________________________
From: Dan Fandrich <dan_at_coneharvesters.com>
To: curl-users_at_cool.haxx.se
Sent: Mon, February 28, 2011 2:13:35 PM
Subject: Re: is --interface or CURLOPT_INTERFACE bugged?

On Sat, Feb 26, 2011 at 04:16:55PM -0800, Bryan Schaefer wrote:
> However, when i try either of the following:
>
> curl --interface eth0 http://freedns.afraid.org (or any interface, or an IP of
> any interface)
>
> or
>
> my $curl = WWW::Curl::Easy->new;
> $curl->setopt(CURLOPT_INTERFACE, 'eth0');
> $curl->setopt(CURLOPT_URL, 'http://freedns.afraid.org');
> $output = $curl->perform;
> print $output;
>
> it times out, returning code 7, could not connect to host.
>
> Am I doing something wrong, or is the interface option wrong?

This is most easily explained by eth0 not being the correct interface to
use :-) But you're using --interface correctly, so there must be something
going on. What does the -v option show? Does "ping -I eth0 freedns.afraid.org"
work?

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html

      

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-03-01