Menu ▾ ▴

#68 ipv6: UnknownHostException on valid link-local address

v1.0 (example)
open
nobody
None
5
2015-02-04
2013-11-30
Gerry Reno
No

Using JSch 0.1.50

The target machine has this link-local ipv6 address: fe80::218:f8ff:fe0b:554b%eth0

So I've tried to connect using both: fe80::218:f8ff:fe0b:554b and fe80::218:f8ff:fe0b:554b%eth0 (with and without
the scope id / inf)

What I end up with is the following errors:

ERROR: com.jcraft.jsch.JSchException java.net.ConnectException: failed to connect to /fe80::218:f8ff:fe0b:554b (port
22): connect failed: EINVAL (Invalid argument)

ERROR: com.jcraft.jsch.JSchException java.net.UnknownHostException: Unable to resolve host
"fe80::218:f8ff:fe0b:554b%eth0": No address associated with hostname

From the UnknownHostException error it appears that the ipv6 address is being treated as a hostname rather than an IP.

I am able to ping6 the address%inf:

$ ping6 fe80::218:f8ff:fe0b:554b%eth0
PING fe80::218:f8ff:fe0b:554b%eth0(fe80::218:f8ff:fe0b:554b) 56 data bytes
64 bytes from fe80::218:f8ff:fe0b:554b: icmp_seq=1 ttl=64 time=0.380 ms
64 bytes from fe80::218:f8ff:fe0b:554b: icmp_seq=2 ttl=64 time=0.233 ms
64 bytes from fe80::218:f8ff:fe0b:554b: icmp_seq=3 ttl=64 time=0.284 ms

I am also able to login using openssh from the command line:

$ ssh xxxxxxxx@fe80::218:f8ff:fe0b:554b%eth0
Last login: Fri Nov 29 14:00:42 2013 from fe80::a2e:5fff:fe74:9e8d%eth0
$

But I have not been able to figure a way to get JSch to connect successfully using ipv6.

Discussion


Log in to post a comment.