wget and cURL an explicit IPv6 Address
This seems to be a bug in wget: https://bugs.launchpad.net/ubuntu/+source/wget/+bug/1566930
Apparently, wget does not correctly parse the scope added to the link-local IPv6 address.
I'd recommend giving your server(s) actual IPv6 addresses, either public ones, or, if you can't get those, ULAs (unique local adresses). These do work without scope identifier and thus also work in wget.
Related videos on Youtube
Juicy
Updated on September 18, 2022Comments
-
Juicy over 1 year
You can use the
-6
flag in cURL or wget to use the IPv6 address of a domain, likegoogle.com
.I was unable to fetch pages by explicitly passing an IPv6 address.
I tried:
wget -6 http://[fe80::a00:27ff:fe00:80b9]:8080/
That host is definitely running a server on on
8080
over IPv6 on my local network, confirmed withnetstat
andifconfig
. When I run the above I getConnecting to fe80:a00:27ff:fe00:80b9:8080... failed: Invalid argument
. It's obvious by the error message that the IPv6 address and port are not interpreted as I was expecting.When I google, all examples are for using
-6
and a domain name, couldn't find an example with explicit IPv6 address.-
Pankaj Goyal about 7 yearsPlease provide more specificity. What error did you get, for example?
-
Pankaj Goyal about 7 yearsTry wrapping the URL in strong quotes? (e. g.
curl -6 'http://[fe80::aa00:27ff:fe00:80b9]:8080/'
) -
Juicy about 7 years@DopeGhoti that works for
curl
actually, (need to specify interface ie:[fe80::1%25wlan0]
). Still can't getwget
to work with an IPv6 address)
-