Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 has a wrong default behaviour #2539

Closed
cyberduck opened this issue Sep 3, 2008 · 16 comments
Closed

IPv6 has a wrong default behaviour #2539

cyberduck opened this issue Sep 3, 2008 · 16 comments

Comments

@cyberduck
Copy link
Collaborator

anonymous created the issue

Hi, despite the 'defaults' fix, at the moment 3.8.1 does not work with an IPv6 only SSH server, using a host name that has both A and AAAA records:

Connect to godzilla.terena.org -> Network Error: Connection failed

Connecting to the bare address (2001:610:148:dead::6) works fine.
Connecting to a hostname that ONLY lists a AAAA record (godzilla.ipv6.terena.org) also works fine...

FYI this is 10.6.6.

Thanks.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

How do you conclude it does not work? I have never tested because I don't have a IPV6 network here but in theory it should work for SFTP.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

I tested several IPv6 Accessible FTP Sites and haven't found any issue.

@cyberduck
Copy link
Collaborator Author

0e37d19 commented

IPv6 support is supposed to have the following behaviour :

  • IPv6 should be tried first IF the host has an AAAA record AND localhost has a global IPv6 address (not just the local link one)
  • If both A and AAAA records are avaible for the host, AAAA should have precedence
  • UNLESS User is given explicit choice to default to IPv4

My test showed that for an host beeing reachable on both protocols, also having both A and AAAA records, Cyberduck defaults to IPv4

I couldn't find any setting to change this faulty behaviour.

When given with an IPv6 adress, cyberduck rightfully uses IPv6.

@cyberduck
Copy link
Collaborator Author

018bff7 commented

I second that, with build 3.1.2 (4500). A is preferred over AAAA. If you need access to a testing server with both A and AAAA records or any other help with this, David, let me know. Any idea for a fix timeline? Thanks, Dominik

@cyberduck
Copy link
Collaborator Author

@dkocher commented

According to (http://java.sun.com/j2se/1.5.0/docs/guide/net/ipv6_guide/index.html#ipv6-related) which also applies to Cyberduck:

  • By default, we would prefer IPv4 addresses over IPv6 addresses, i.e., when querying the name service (e.g., DNS service), we would return IPv4 addresses ahead of IPv6 addresses.

To test IPv6 you therefore have to set the java.net.preferIPv6Addresses property to true in the Info.plist of Cyberduck.app/Contents.

Using Passive FTP there may be problems connecting, as we do not currently support the IPv6 FTP extensions to parse a IPv6 address in response to PASV.

@cyberduck
Copy link
Collaborator Author

018bff7 commented

Thanks for the update, David. I tried your suggestion. Following this document (http://developer.apple.com/documentation/Java/Reference/Java_InfoplistRef/Articles/JavaDictionaryInfo.plistKeys.html), in the Info.plist, I created a dictionary Properties as a child of the dictionary Java, then a child key java.net.preferIPv6Addresses and set it to a string true. Unfortunately, it looks like Cyberduck still prefers IPv4. What should the Info.plist look like in order to get that to work? Did you try it out yourself?

Regarding the PASV problems, I can confirm them. It fails for example when using an explicit IPv6 address. From my point of view, that's not such a high priority issue as PASV mode could be less urgently required when you use IPv6.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:7 d-r@…]:
I cannot verify this before Monday. As another option try using the key VMOptions with <string>-Djava.net.preferIPv6Addresses=true</string>. See [source:trunk/Info.plist.debug] as a reference.

@cyberduck
Copy link
Collaborator Author

018bff7 commented

That trick worked, now the connection is made to the IPv6 address, that's good. But it looks like a Bookmark's Active/Passive Setting is ignored. That's why LS works, but transfers always fail with "Cannot assign address".

@cyberduck
Copy link
Collaborator Author

@dkocher commented

See #2885 for related issue.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

We now have support for EPSV and EPRT as of 029d2a1.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:3 jerome@…]:

IPv6 support is supposed to have the following behaviour :

  • IPv6 should be tried first IF the host has an AAAA record AND localhost has a global IPv6 address (not just the local link one)
  • If both A and AAAA records are avaible for the host, AAAA should have precedence
  • UNLESS User is given explicit choice to default to IPv4

My test showed that for an host beeing reachable on both protocols, also having both A and AAAA records, Cyberduck defaults to IPv4

I couldn't find any setting to change this faulty behaviour.

When given with an IPv6 adress, cyberduck rightfully uses IPv6.

Can you direct me to the RFCs describing this? At my own setup this scenario not usable: With the java.net.preferIPv6Addresses property described above the AAAA takes precedence but I have no IPv6 routing connecting to the address therefore fails.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:11 dkocher]:

We now have support for EPSV and EPRT as of 029d2a1.

The nightly build is now available.

@cyberduck
Copy link
Collaborator Author

018bff7 commented

I tested the nightly, works for me. Great! Thanks a lot, good work. I had to apply the address selection tweak, but then it works nicely against a ProFTPd server.

Regarding address selection, according to this article [1] it should be RFC 3484.

[1] http://www.cisco.com/web/about/ac123/ac147/archived_issues/ipj_9-3/ipv6_internals.html

@cyberduck
Copy link
Collaborator Author

@dkocher commented

I will not currently change the default behaviour. However you can change the preference using the defaults command in Terminal.app to give IPv6 AAAA records preference when connecting. Use

defaults write ch.sudo.cyberduck connection.dns.ipv6 true

This allows you to change the configuration without editing the Info.plist. As of 80de04d.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

In b1e1a22.

@iterate-ch iterate-ch locked as resolved and limited conversation to collaborators Nov 26, 2021
@dkocher
Copy link
Contributor

dkocher commented Feb 28, 2023

Follow-up in #14286.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants