0 votes
by (120 points)
retagged by

Hello, I connecting to ftp for example ftp.ripe.net by IPV4 connection protocol. Everything is ok. Next when I make new connection to ipv6 and make the same connect to ftp.ripe.net. I got error message:

12:43:28 - Error message: Could not connect to server. A socket operation was attempted to an unreachable network 193.0.6.140:21

I prepared trace.
IPV4 is ok DNS resolve and connect to FTP
IPV6 missing DNS resolve and FTP connect too

How we can use ftp -> IPV6

Thanx

Applies to: Rebex FTP/SSL

1 Answer

0 votes
by (58.9k points)

Hello,

IPv6 is supported by Rebex FTP client. At the moment Rebex FTP prefers IPv4 addresses and only uses IPv6 address if no IPv4 address is available for a hotname.

I prepared a code that tries to connect to the first IPv6 address available and it reports that there are actually no IPv6 addresses for the "ftp.ripe.net" FTP server.

        IPHostEntry ipEntry = Dns.GetHostEntry("ftp.ripe.net");
        IPAddress[] addresses = ipEntry.AddressList;

        IPAddress ipv6 = null;
        foreach (var address in addresses)
        {
            if (address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
            {
                ipv6 = address;
                break;
            }
        }

        if (ipv6 == null)
            throw new ApplicationException("No IPv6 address");

        Ftp ftp = new Ftp();
        ftp.Connect(ipv6.ToString());

Running the code, are you sure there is an IPv6 address for your FTP server?

...