error in opening website from ipv6 address

时间:2022-10-06 09:11:13

I have installed apache2 in my ubunntu 12.10 system with inet addr 172.16.17.235 and inet6 addr fe80::a05b:25ff:fef0:68a4/64 in LAN.

Now when i want to open default website (index.html) located in /var/www/ , i simply write
http://localhost or
http://127.0.0.1 or
http://172.16.17.235 in my web browser(firefox 17.0) and it opens that index.html page
but when i want to access this index.html with the help of ipv6 addressing as below :
http://[::1] or
http://[fe80::a05b:25ff:fef0:68a4]

following error is shown by browser :
Unable to connect Firefox
can't establish a connection to the server at [::1] or
Firefox can't establish a connection to the server at [fe80::a05b:25ff:fef0:68a4].

我已经在我的ubunntu 12.10系统中使用inet addr 172.16.17.235和inet6 addr fe80 :: a05b:25ff:fef0:68a4 / 64在局域网中安装了apache2。现在,当我想打开位于/ var / www /的默认网站(index.html)时,我只需在我的网络浏览器中编写http:// localhost或http://127.0.0.1或http://172.16.17.235( firefox 17.0)并打开index.html页面,但是当我想在ipv6寻址的帮助下访问这个index.html,如下所示:http:// [:: 1]或http:// [fe80 :: a05b: 25ff:fef0:68a4]浏览器显示以下错误:无法连接Firefox无法在[:: 1]建立与服务器的连接,或者Firefox无法在[fe80 :: a05b:与服务器建立连接: 25ff:fef0:68a4。

Can any one tell me what configuration am i missing in my system or what i am doing wrong.

任何人都可以告诉我我的系统中缺少什么配置或我做错了什么。

BTW when i ping to my localhost as :
ping6 ::1 or ping6 -I eth0 fe80::a05b:25ff:fef0:68a4
ping reply is coming fine as :
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.032 ms
or
64 bytes from fe80::a05b:25ff:fef0:68a4: icmp_seq=1 ttl=64 time=0.048 ms

BTW,当我ping我的localhost时:ping6 :: 1或ping6 -I eth0 fe80 :: a05b:25ff:fef0:68a4 ping回复正好如下:64字节来自:: 1:icmp_seq = 1 ttl = 64 time =来自fe80 :: a05b的0.032 ms或64字节:25ff:fef0:68a4:icmp_seq = 1 ttl = 64 time = 0.048 ms

1 个解决方案

#1


1  

If you want to use an IPv6 address from the fe80:: range, you must specify over which network adapter it should go. (Technically, you must provide the Zone ID which correlates with the network adapter used).

如果要使用fe80 :: range中的IPv6地址,则必须指定应该使用哪个网络适配器。 (从技术上讲,您必须提供与所使用的网络适配器相关的区域ID)。

On ping, you do that with -l eth0. In Firefox, you can do that with http://[fe80::a05b:25ff:fef0:68a4%x] where x is a positive number you must find out.

在ping上,使用-l eth0执行此操作。在Firefox中,你可以用http:// [fe80 :: a05b:25ff:fef0:68a4%x]来做到这一点,其中x是你必须找到的正数。


EDIT: If you absolutely don't find out what is going on, you could try this:

编辑:如果你绝对不知道发生了什么,你可以试试这个:

python -c 'import sys,socket; print socket.getaddrinfo(sys.argv[1], (sys.argv[2:]+[0])[0], 0, socket.SOCK_STREAM)' fe80::a05b:25ff:fef0:68a4%eth0

and have a look to the result. On my system, it looks like

并查看结果。在我的系统上,它看起来像

[(10, 1, 6, '', ('fe80::a05b:25ff:fef0:68a4%eth0', 0, 0, 3))]

where the last number, the 3, is the real Zone ID.

最后一个数字3是真实的区域ID。

If this gives you a result, your name resolution works fine, if not, it is broken.

如果这给你一个结果,你的名字解析工作正常,如果没有,它就会被破坏。

The next step could be to try to create a HTTP connection:

下一步可能是尝试创建HTTP连接:

python -c 'import sys,socket; c=socket.create_connection((sys.argv[1], 80)); c.send("GET / HTTP/1.0\n\n"); print c.recv(100000).split("\r\n\r\n",1)[0]' fe80::a05b:25ff:fef0:68a4%eth0

If that works, the problem is your browser, if not, you cannot reach the server due to whatever reason. (Does your web server daemon bind to IPv6?)

如果可行,问题是您的浏览器,如果没有,则由于任何原因您无法访问服务器。 (您的Web服务器守护程序是否绑定到IPv6?)

#1


1  

If you want to use an IPv6 address from the fe80:: range, you must specify over which network adapter it should go. (Technically, you must provide the Zone ID which correlates with the network adapter used).

如果要使用fe80 :: range中的IPv6地址,则必须指定应该使用哪个网络适配器。 (从技术上讲,您必须提供与所使用的网络适配器相关的区域ID)。

On ping, you do that with -l eth0. In Firefox, you can do that with http://[fe80::a05b:25ff:fef0:68a4%x] where x is a positive number you must find out.

在ping上,使用-l eth0执行此操作。在Firefox中,你可以用http:// [fe80 :: a05b:25ff:fef0:68a4%x]来做到这一点,其中x是你必须找到的正数。


EDIT: If you absolutely don't find out what is going on, you could try this:

编辑:如果你绝对不知道发生了什么,你可以试试这个:

python -c 'import sys,socket; print socket.getaddrinfo(sys.argv[1], (sys.argv[2:]+[0])[0], 0, socket.SOCK_STREAM)' fe80::a05b:25ff:fef0:68a4%eth0

and have a look to the result. On my system, it looks like

并查看结果。在我的系统上,它看起来像

[(10, 1, 6, '', ('fe80::a05b:25ff:fef0:68a4%eth0', 0, 0, 3))]

where the last number, the 3, is the real Zone ID.

最后一个数字3是真实的区域ID。

If this gives you a result, your name resolution works fine, if not, it is broken.

如果这给你一个结果,你的名字解析工作正常,如果没有,它就会被破坏。

The next step could be to try to create a HTTP connection:

下一步可能是尝试创建HTTP连接:

python -c 'import sys,socket; c=socket.create_connection((sys.argv[1], 80)); c.send("GET / HTTP/1.0\n\n"); print c.recv(100000).split("\r\n\r\n",1)[0]' fe80::a05b:25ff:fef0:68a4%eth0

If that works, the problem is your browser, if not, you cannot reach the server due to whatever reason. (Does your web server daemon bind to IPv6?)

如果可行,问题是您的浏览器,如果没有,则由于任何原因您无法访问服务器。 (您的Web服务器守护程序是否绑定到IPv6?)