我已经通过/etc/network/interfaces
分配/ 64的IPv6子网到我的专用主机(分布是Debian的挤压)分配特定的IPv6地址卷曲
iface eth0 inet6 static
address 2a01:4f8:XXXX:YYYY::2
netmask 64
gateway fe80::1
现在,我想卷曲(PHP 5.3。 22-1〜dotdeb.0)使用该子网的一个特定IP地址pe 2a01:4f8:XXXX:YYYY::3
所以我的代码如下所示:
curl_setopt($this->_curl, CURLOPT_INTERFACE, '2a01:4f8:XXXX:YYYY::3');
curl_setopt($this->_curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
当运行curl_exec
我得到bind failed with errno 99: Cannot assign requested address
。为什么会发生? 当用作/ 128在/etc/network/interfaces
定义每个IPv6地址,如:
iface eth0 inet6 static
address 2a01:4f8:XXXX:YYYY::2
netmask 128
up ip -6 addr add 2a01:4f8:XXXX:YYYY::3/128 dev eth0 preferred_lft 0
gateway fe80::1
然后所有的罚款和卷曲使用::3
IP。但是我的意图是从我的子网使用很多IP(实际上是很多IP),所以这是不切实际的。 有谁知道为什么cURL无法分配/ 64子网的子IP?
在'/ etc/network/interfaces'中,你的意思是'up ip -6 addr add ...'而不是'ip -6 addr add ...'?我相信这是一个语法错误,因为它出现在你的问题中。 – Celada 2013-03-07 11:57:16
@Celada:你说得对(复制并粘贴失败),谢谢 – rabudde 2013-03-07 13:37:01