0

Here is my ldapsearch command with debug (I've masked my real IP address):

$ sudo /usr/local/bin/ldapsearch -H ldap://99.99.99.99 -b dc=my-domain,dc=com -x -d -1
ldap_url_parse_ext(ldap://99.99.99.99)
ldap_create
ldap_url_parse_ext(ldap://99.99.99.99:389/??base)
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP 99.99.99.99:389
ldap_new_socket: 3
ldap_prepare_socket: 3
ldap_connect_to_host: Trying 99.99.99.99:389
ldap_pvt_connect: fd: 3 tm: -1 async: 0
attempting to connect:
connect errno: 110
ldap_close_socket: 3
ldap_err2string
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

Yet, running sudo /usr/local/bin/ldapsearch -H ldap://localhost -b dc=my-domain,dc=com -x works just fine. I also did netstat -plane | grep ":389" and I get this printout:

tcp        0      0 0.0.0.0:389             0.0.0.0:*               LISTEN      0          521074687  20249/slapd
tcp6       0      0 :::389                  :::*                    LISTEN      0          521074688  20249/slapd

Here is my iptables -L -v output:

Chain INPUT (policy ACCEPT 10M packets, 938M bytes)
 pkts bytes target     prot opt in     out     source               destination      
 1349  294K ACCEPT     tcp  --  any    any     anywhere             anywhere                  tcp dpt:https

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination      

Chain OUTPUT (policy ACCEPT 10M packets, 982M bytes)
 pkts bytes target     prot opt in     out     source               destination
0

Turns out you can't test external connections like that when on the machine itself (some sort of loopback problems). Testing the connection from a different machine worked fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.