I am trying to curl ipv6 addresses, but without success.
If I try lets say:
curl https://google.com
I wait for a timeout and get network unreachable
If I force ipv4
, everything is fine.
curl -4 https://google.com
Then again if I force ipv6, like this:
curl -6 https://google.com
I get:
curl: (7) Failed to connect to 2800:3f0:4001:806::1005: Network is unreachable
I suppose it has to do somehow with resolving ipv6
addresses.
I saw that on other computers that have a newer version of some Linux distro, these requests go fine, so I'm guessing it has to do something with me using Ubuntu 10.10
, where this problem isn't solved.
I want to be able to curl normally without using the option: -4
, what do I have to modify to be able to use curl normally with ipv6
addresses?
Best Answer
It is not a problem with resolving IPv6 addresses. That name resolution is working fine because curl reports that it cannot reach network 2800:3f0:4001:806::1005; this shows that the name translation did succeed. This is different than an error in name lookup:
In order to reach an IPv6 address, you need to have a route to the destination address and very few connections have any IPv6 connectivity at all. On the machine I'm writing this, I have almost no v6 routes at all:
which says you I know how to reach my local network and nothing more. Contrast this with my IPv4 routes
which shows I've got one very critical bit of routing information. I know how to get to anywhere that I don't have an explicit route to by handing the packet to my default router at 192.168.1.1.
Your name resolution is working just fine. You do need an IPv6 route to the destination network and too few places provide that facility yet.