Я пытаюсь создать PHP-скрипт, который генерирует и назначает случайный IPv6-адрес для eth0 и выполняет HTTP-запрос, но кажется, что все адреса необходимо «инициализировать», сначала сделав фиктивный запрос. Однако мне нужно, чтобы IP был готов к HTTP-запросу в течение секунды после создания. После многих часов тестирования и поиска в интернете я не мог понять проблему, поэтому я пришел сюда.
Мой Debian VPS имеет назначенное ему / 64 адресное пространство IPv6.
Чтобы объяснить проблему, я сделал это:
Сначала я вручную назначаю 9 IP
ip addr change 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:1 dev eth0 valid_lft 600 preferred_lft 600
ip addr change 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:2 dev eth0 valid_lft 600 preferred_lft 600
ip addr change 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:3 dev eth0 valid_lft 600 preferred_lft 600
ip addr change 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:4 dev eth0 valid_lft 600 preferred_lft 600
ip addr change 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:5 dev eth0 valid_lft 600 preferred_lft 600
ip addr change 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:6 dev eth0 valid_lft 600 preferred_lft 600
ip addr change 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:7 dev eth0 valid_lft 600 preferred_lft 600
ip addr change 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:8 dev eth0 valid_lft 600 preferred_lft 600
ip addr change 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:9 dev eth0 valid_lft 600 preferred_lft 600
PHP скрипт:
<?php
$URL = "ipv6.whatismyv6.com";
for($i=1; $i<10; $i++)
{
$ch = curl_init();
$IP = "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:{$i}";
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE);
// Set IPv6
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
curl_setopt($ch, CURLOPT_INTERFACE, $IP);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
print "IP {$IP}\n";
curl_exec($ch);
if(curl_errno($ch))
die(curl_error($ch));
var_dump(curl_getinfo($ch));
print "\nDone for IP {$IP}\n\n";
curl_close($ch);
}
При первом запуске скрипта я получаю этот вывод. Как вы видите, connect_time составляет 32 секунды для каждого, кроме первого запроса. Похоже, что cURL занимает время в течение 30 секунд, прежде чем пытаться подключиться.
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:1
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(2.041753)
["namelookup_time"]=>
float(0.969251)
["connect_time"]=>
float(2.002953)
["pretransfer_time"]=>
float(2.002985)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(708)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(2.04171)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:1"["local_port"]=>
int(46353)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:1
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:2
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(32.02449)
["namelookup_time"]=>
float(3.1E-5)
["connect_time"]=>
float(31.986268)
["pretransfer_time"]=>
float(31.986298)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(45)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(32.024464)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:2"["local_port"]=>
int(53907)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:2
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:3
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(32.080273)
["namelookup_time"]=>
float(1.9E-5)
["connect_time"]=>
float(32.041328)
["pretransfer_time"]=>
float(32.041358)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(45)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(32.080247)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:3"["local_port"]=>
int(56910)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:3
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:4
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(32.124284)
["namelookup_time"]=>
float(1.9E-5)
["connect_time"]=>
float(32.085118)
["pretransfer_time"]=>
float(32.085152)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(45)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(32.124239)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:4"["local_port"]=>
int(59346)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:4
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:5
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(32.074903)
["namelookup_time"]=>
float(1.6E-5)
["connect_time"]=>
float(32.036185)
["pretransfer_time"]=>
float(32.036232)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(45)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(32.074879)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:5"["local_port"]=>
int(50604)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:5
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:6
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(32.425055)
["namelookup_time"]=>
float(0.35623)
["connect_time"]=>
float(32.386056)
["pretransfer_time"]=>
float(32.386088)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(44)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(32.425031)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:6"["local_port"]=>
int(35632)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:6
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:7
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(35.150028)
["namelookup_time"]=>
float(2.0E-5)
["connect_time"]=>
float(35.111304)
["pretransfer_time"]=>
float(35.111331)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(41)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(35.149998)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:7"["local_port"]=>
int(54827)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:7
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:8
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(32.09912)
["namelookup_time"]=>
float(2.0E-5)
["connect_time"]=>
float(32.06125)
["pretransfer_time"]=>
float(32.061287)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(45)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(32.099082)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:8"["local_port"]=>
int(45077)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:8
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:9
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(32.050919)
["namelookup_time"]=>
float(2.4E-5)
["connect_time"]=>
float(32.011934)
["pretransfer_time"]=>
float(32.01196)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(45)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(32.050894)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:9"["local_port"]=>
int(48069)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:9
Я сразу же запустил скрипт после первого запуска, и на этот раз это был выход. Теперь с connect_time все хорошо, и я бы хотел, чтобы так было и в первом запросе.
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:1
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(1.00357)
["namelookup_time"]=>
float(0.93072)
["connect_time"]=>
float(0.966039)
["pretransfer_time"]=>
float(0.966092)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(1440)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(1.003512)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:1"["local_port"]=>
int(42623)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:1
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:2
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(0.074783)
["namelookup_time"]=>
float(1.6E-5)
["connect_time"]=>
float(0.035955)
["pretransfer_time"]=>
float(0.035979)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(19335)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(0.07476)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:2"["local_port"]=>
int(60928)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:2
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:3
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(0.076524)
["namelookup_time"]=>
float(2.2E-5)
["connect_time"]=>
float(0.03672)
["pretransfer_time"]=>
float(0.036757)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(18896)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(0.076497)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:3"["local_port"]=>
int(37292)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:3
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:4
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(0.074629)
["namelookup_time"]=>
float(2.1E-5)
["connect_time"]=>
float(0.035955)
["pretransfer_time"]=>
float(0.036001)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(19375)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(0.074593)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:4"["local_port"]=>
int(53553)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:4
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:5
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(0.074592)
["namelookup_time"]=>
float(2.0E-5)
["connect_time"]=>
float(0.036058)
["pretransfer_time"]=>
float(0.036093)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(19385)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(0.074564)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:5"["local_port"]=>
int(51041)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:5
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:6
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(0.074324)
["namelookup_time"]=>
float(1.9E-5)
["connect_time"]=>
float(0.035745)
["pretransfer_time"]=>
float(0.035784)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(19455)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(0.074282)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:6"["local_port"]=>
int(37542)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:6
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:7
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(0.07241)
["namelookup_time"]=>
float(2.3E-5)
["connect_time"]=>
float(0.035187)
["pretransfer_time"]=>
float(0.035246)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(19969)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(0.072382)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:7"["local_port"]=>
int(50575)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:7
IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:8
array(27) {
["url"]=>
string(26) "HTTP://ipv6.whatismyv6.com"["content_type"]=>
string(9) "text/html"["http_code"]=>
int(200)
["header_size"]=>
int(174)
["request_size"]=>
int(58)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(0.074898)
["namelookup_time"]=>
float(2.1E-5)
["connect_time"]=>
float(0.036041)
["pretransfer_time"]=>
float(0.036079)
["size_upload"]=>
float(0)
["size_download"]=>
float(1446)
["speed_download"]=>
float(19306)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(1446)
["upload_content_length"]=>
float(0)
["starttransfer_time"]=>
float(0.074861)
["redirect_time"]=>
float(0)
["certinfo"]=>
array(0) {
}
["primary_ip"]=>
string(14) "2001:4810::110"["primary_port"]=>
int(80)
["local_ip"]=>
string(33) "2001:19f0:xxxx:xxxx:xxxx:xxxx:2:8"["local_port"]=>
int(58766)
["redirect_url"]=>
string(0) ""["request_header"]=>
string(58) "GET / HTTP/1.1
Host: ipv6.whatismyv6.com
Accept: */*
"}
Done for IP 2001:19f0:xxxx:xxxx:xxxx:xxxx:2:8
Также,
wget --bind-address=2001:19f0:xxxx:xxxx:xxxx:xxxx:3:1 http://ipv6.whatismyv6.com
работает просто отлично, как первый запрос в сценарии PHP.
Я боролся с этим в течение нескольких дней, поэтому любая помощь очень ценится.
После добавления адреса IPv6 система обычно выполняет обнаружение дублирующихся адресов (DAD), чтобы убедиться, что ни одна другая система не использует этот же адрес. Это может занять несколько секунд. Если вам действительно нужно использовать адрес сразу, вам нужно отключить DAD на интерфейсе:
echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_dad
Других решений пока нет …