如何使用链接本地IPv6地址访问Web服务器或网站? [英] How do I access the web server or website using link local IPv6 address?

查看:650
本文介绍了如何使用链接本地IPv6地址访问Web服务器或网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是托管Web服务器的计算机的ipconfig的输出:

Below is the output of the ipconfig of the machine where web server is hosted:

以太网适配器本地连接:

Ethernet adapter Local Area Connection:

特定于连接的DNS后缀. :链接本地IPv6地址. . . . . :fe80 :: f85b:4256:ee76:24a4%11 IPv4地址. . . . . . . . . . . :10.213.254.119子网掩码. . . . . . . . . . : 255.255.255.0默认网关. . . . . . . . . :10.213.254.252

Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::f85b:4256:ee76:24a4%11 IPv4 Address. . . . . . . . . . . : 10.213.254.119 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 10.213.254.252

我可以使用以下网址访问该网站:" http://10.213.254.119/test " 现在,我想知道如何使用链接本地IPv6地址访问同一页面?

I can access the website using say: "http://10.213.254.119/test" Now I am interested to know how can I access the same page using link local IPv6 address?

推荐答案

我发现大多数浏览器都不支持URL中的作用域标识符.由于链接本地地址通常需要范围标识符,因此这意味着那些浏览器无法访问链接本地地址.创建指向链接本地地址的DNS条目也不起作用,因为该DNS条目无法指定作用域标识符.

I found that most browsers don't support scope identifiers in URLs. Since scope identifiers are usually required for link-local addresses, that means those browsers can't access link-local addresses. Creating a DNS entry pointing to the link-local address won't work either since the DNS entry cannot specify a scope identifier.

有时我需要访问设备的Web界面,该设备甚至不在同一链接上.这意味着我有两个障碍,无法使用本地链接地址访问它.但是我找到了一种简单的方法,可以为我解决这两个问题.

Sometimes I have needed to access the webinterface of equipment which wasn't even on the same link. That means I would have two obstacles preventing me from using a link-local address to access it. But I found a simple method which solved both of those problems for me.

在运行浏览器的主机上运行ssh客户端.通过本地链接地址直接链接到要访问的设备的主机,并设置端口转发.例如,执行此命令的命令应如下所示:

Run an ssh client on the host where the browser is running. Connect to a host with a direct link to the equipment I want to access through a link-local address, and set up a port-forwarding. For example the command to do so could look like this:

ssh -L '8080:[fe80::200:5eff:fe00:53b6%eth0]:80' host.example.com

这时我可以通过本地主机访问它,它不需要作用域标识符:http://[::1]:8080/.如果ssh客户端和ssh服务器恰好都与webbrowser在同一台计算机上运行,​​那么这当然也适用.

At this point I can access it through localhost, which doesn't require a scope identifier: http://[::1]:8080/. This of course also works if ssh client and ssh server happen to both be running on the same machine as the webbrowser.

这篇关于如何使用链接本地IPv6地址访问Web服务器或网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆