wget force IPv4/6 download

If your server support both IPv4 and IPv6 and you need to force download a file using IPv4, you can use

wget -4 URL_HERE

To force IPv6 connection, use

wget -6 URL_HERE

Example

[root@li2136-233 ~]# wget -4 https://rpms.remirepo.net/enterprise/remi-release-7.rpm
--2020-09-22 04:45:30--  https://rpms.remirepo.net/enterprise/remi-release-7.rpm
Resolving rpms.remirepo.net (rpms.remirepo.net)... 195.154.241.117
Connecting to rpms.remirepo.net (rpms.remirepo.net)|195.154.241.117|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 20732 (20K) [application/x-rpm]
Saving to: ‘remi-release-7.rpm’

100%[==================================================================================================================================================================>] 20,732      74.2KB/s   in 0.3s   

2020-09-22 04:45:32 (74.2 KB/s) - ‘remi-release-7.rpm’ saved [20732/20732]

[root@li2136-233 ~]# 

from wget help, here are the options

wget IPv4 connection

See wget

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *