How to telnet to an IPv6 host using Mac OS X

ipv6mac-osxnetworking

I’m testing IPv6 on a corporate network and having problems with OS X. With most IPv6 commands, such as telnet -6 or traceroute6, I get the error:

connect: No route to host

For example, I have a web server. This fails:

$ telnet -6 fe80::… 80    # this fails

I know the server is reachable because ping6 works (note that I have to use the -I argument):

$ ping6 -I en1 fe80::…    # this works

And I know the web server is running because I can telnet to it from Windows:

C:\> telnet fe80::… 80  # this works

I suspect there is some configuration flag or command-line argument that I am missing.

Best Answer

The fe80::/16 prefix is for link-local addresses, and they're special. Try running

netstat -nr

on OS X and

netsh int ipv6 show routes

on Windows. On OS X you will most likely see a separate fe80:: route for each interface, e.g. for lo0 and en1. Windows (XP, at least) doesn't appear to do that. Since OS X has multiple routes to the same prefix you have to use a zone index to point the traffic in the right direction:

$ telnet -6 fe80::…%en1 80