logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: Multi-homed host: msg#00013

Subject: Re: Multi-homed host

On 5 Apr 2004, at 17:11, Chris Ridd wrote:

On 5/4/04 4:52 pm, Peter Marschall <peter@xxxxxxx> wrote:

Hi,

On Monday 05 April 2004 17:31, Safford, Brian wrote:
I have a multi-homed host, and I need to be able to specify an IP address or local host name to use for the connection to the LDAP server in my $ldap = Net::LDAP new () statement ... is this possible? I don't see a 'bindip'
or similar argument in the documentation.

Quite simple. Do

$ldap = Net::LDAP->new('IP.AD.DR.ESS', ...);

where IP.AD.DR.ESS is the IP address you want to connect to.
If this IP address has a specific DNS entry you can use that as well.

Peter

I'm not sure, but I think Brian wants to set the local address that his
connections come from, rather than the address of the remote server.

Thats my reading too. I thought someone sent a patch for that. maybe I am thinking of another module of mine, in libnet, perhaps.

I don't think this is currently possible, although the underlying
IO::Socket::INET object supports the setting of 'LocalAddr'. You could
override the Net::LDAP->connect_ldap method in your code and set whatever
you want in there, though that would be an ugly hack and not something
anyone would advise :-)

Adding a localaddr argument to new() and passing it to connect methods is easy.

OTOH, perhaps Brian's missing the 'multihomed' => 1 arguments to
Net::LDAP->new(), which means you can pass a reference to an array of hosts
to connect to, rather than a single scalar.

No, thats not what multihomed does. multihomed has nothing todo with passing an array of hosts, that is always possible.

multihomed is passed to IO::Socket::INET. The result will be that if the host has multiple IP addresses returned from the DNS lookup, then each will be tried in turn before IO::Socket::INET fails.

Graham.





Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>