wget and cURL an explicit IPv6 Address

28,300

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.

Share:
28,300

Related videos on Youtube

Juicy
Author by

Juicy

Updated on September 18, 2022

Comments

  • Juicy
    Juicy over 1 year

    You can use the -6 flag in cURL or wget to use the IPv6 address of a domain, like google.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 with netstat and ifconfig. When I run the above I get Connecting 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
      Pankaj Goyal about 7 years
      Please provide more specificity. What error did you get, for example?
    • Pankaj Goyal
      Pankaj Goyal about 7 years
      Try wrapping the URL in strong quotes? (e. g. curl -6 'http://[fe80::aa00:27ff:fe00:80b9]:8080/')
    • Juicy
      Juicy about 7 years
      @DopeGhoti that works for curl actually, (need to specify interface ie: [fe80::1%25wlan0]). Still can't get wget to work with an IPv6 address)