I try to specify wireless interface for curl, but something not working properly.
When lan cable disconnected, it works as expected. when lan cable is plugged in, connection timed out.
See log below, first attempt with plugged in lan cable.
user@user-Latitude-E6410:~/Downloads/ATS$ sudo curl http://speedtest4.ziggo.nl/testfile_20G.bin -o /dev/null --retry 0 --limit-rate 500000 --speed-limit 3000 --speed-time 2 --connect-timeout 5 --interface wlp2s0 --verbose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 212.54.52.11...
* Local Interface wlp2s0 is ip 192.168.2.73 using address family 2
* Local port: 0
* Connected to speedtest4.ziggo.nl (212.54.52.11) port 80 (#0)
> GET /testfile_20G.bin HTTP/1.1
> Host: speedtest4.ziggo.nl
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 20 Oct 2016 20:57:28 GMT
< Server: Apache
< Last-Modified: Tue, 10 Mar 2015 13:29:21 GMT
< ETag: "500000000-510ef23751ccf"
< Accept-Ranges: bytes
< Content-Length: 21474836480
< Content-Type: application/octet-stream
<
^{ [4018 bytes data]
0 20.0G 0 16.1M 0 0 487k 0 11:56:28 0:00:33 11:55:55 488k^C
user@user-Latitude-E6410:~/Downloads/ATS$ sudo curl http://speedtest4.ziggo.nl/testfile_20G.bin -o /dev/null --retry 0 --limit-rate 500000 --speed-limit 3000 --speed-time 2 --connect-timeout 5 --interface wlp2s0 --verbose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 212.54.52.11...
* Local Interface wlp2s0 is ip 192.168.2.73 using address family 2
* Local port: 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:04 --:--:-- 0* Connection timed out after 5001 milliseconds
0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0
* Closing connection 0
curl: (28) Connection timed out after 5001 milliseconds
You might need to use
--dns-interface
.From the man page: