CESNET / libnetconf

C NETCONF library
Other
113 stars 84 forks source link

nc_session_connect times out with "Unable to connect .. over IPv4 (No route to host)" #271

Closed ghost closed 6 years ago

ghost commented 6 years ago

I am calling nc_session_connect("10.0.0.1", 830, "user", NULL). The function is timing out and displaying the below error:

Trace: Unable to connect to 10.0.0.1:830 over IPv4 (No route to host).
Connection error occurred: Unable to connect to 10.0.0.1:830.

The command line ssh user@10.0.0.1 -p 830 -s netconf works fine.

Note there is a proxy config, which looks like the below:

~> cat ~/.ssh/config
Host 10.0.0.1
      ProxyCommand     ncat --proxy 9.8.0.1:8080 --proxy-type http %h %p
      ServerAliveInterval   10

Any ideas why this could be happening?

michalvasko commented 6 years ago

Hi, I believe ~/.ssh/config is the configuration file of ssh(1), it has nothing to do with any other SSH applications or libraries. So, we would have to implement support for proxy manually, which is definitely not happening for libnetconf and only if there were more requests we would think about supporting it for libnetconf2.

Regards, Michal

ghost commented 6 years ago

Thanks. Do you know of any workaround for this?

michalvasko commented 6 years ago

Hi, not really. The only solution I can imagine is configuring this proxy on some lower level protocol options such as TCP/IP. I do not know if Linux supports anything like this out-of-the-box but my guess would be that it might.

Regards, Michal