问题
Both my device and the host through which i'm trying to access are in the same subnet.
Scenario:
I have a switch and a server in same subnet. I have to access switch using ipv6 link local address from the browser in my server. Can anyone pls tell me the exact syntax??
回答1:
To give an answer specific to browsers: for most common browsers, you can't.
There is a proposed standard format, as Sander Steffann pointed out, for specifying the interface for a URL, which is in RFC 6874.
The developers of both Chromium and Firefox, and seemingly most other browsers, have decided to intentionally not support this. Firefox has actually had ipv6 link-local support intentionally removed. Bug reports are closed as WONTFIX. See Chromium bug 70762, and Firefox bug 700999. Furthermore, WHATWG also rejected implementation of RFC 6874. This has been the case for years, so I doubt anything short of a patch or fork will result in link-local addresses working. It appears that a number of people are quite set on not allowing link-local address support.
One workaround, however, is to use SSH forwarding. For example,
ssh -L '8080:[FE80::XXXX:XXXX:XXXX:XXXX%wlp4s0]:80' localhost
回答2:
A link local address can be valid on multiple links. If for example your system has both Ethernet and Wi-Fi those might be connected to different networks. Therefore you need to add a scope identifier to a link-local address. The syntax for that is to add % and the scope to the IPv6 address. The score is usually the name of the interface, for example eth0
or ens192
on Linux, or 13
on Windows. The value is different on each system, so you'll need to check what to use in your case.
That gives you for example fe80::1111:2222%eth0
. The problem is that % has special meaning in URLs, so you need to escape it. The escape for %
is %25
.
The correct URL syntax is http://[fe80::1111:2222%25eth0]/
. The official standard for this is RFC 6874. Unfortunately many browsers don't follow the standard, so it might not work for you. In that case please file a bug report. There need to be more people complaining to get this fixed.
来源:https://stackoverflow.com/questions/45299648/how-to-access-devices-with-ipv6-link-local-address-from-browserlike-ie-firefox