Commands.page Logo

How to Download Files Using IPv6 Only with Wget on Ubuntu

This article provides a straightforward method for configuring the wget utility to operate exclusively over IPv6 on Ubuntu systems. It covers the specific command-line flag needed to disable IPv4 fallback and ensures your downloads utilize the IPv6 protocol. Follow the steps below to execute IPv6-only downloads efficiently.

Prerequisites

Ensure you have Ubuntu installed and the wget package is available. Most Ubuntu installations include wget by default. If it is missing, install it using the following command:

sudo apt update
sudo apt install wget

Using the IPv6 Flag

To force wget to use IPv6, you must use the -6 command-line option. This tells the program to resolve hostnames to IPv6 addresses only and disables IPv4 connectivity.

The basic syntax is:

wget -6 [URL]

Example Command

If you want to download a file from example.com using only IPv6, run the following command in your terminal:

wget -6 http://example.com/file.zip

If the server supports IPv6, the download will proceed. If the server does not have an IPv6 address or your network lacks IPv6 connectivity, wget will return an error indicating that the host cannot be resolved or connected.

Verifying Connectivity

To confirm your system is using IPv6 before downloading, you can check your interface configuration. Run the following command to see if you have an inet6 address assigned:

ip addr show | grep inet6

If you see an IPv6 address listed, your network interface is ready for IPv6 downloads using the method described above.