How to access devices with IPV6 link local address from browser(like IE,firefox etc)?

20.9k views Asked by At

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??

4

There are 4 answers

0
Sander Steffann On BEST ANSWER

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.

0
NeverBehave On

For those who have no sshd server set up on their laptop and find it would be troublesome to set up one --- try finding port-forward scripts.

Here is a usable python script, without external dependencies.

https://gist.github.com/NeverBehave/357ca63941d4af4ee3f54920be3d1f3c

2
cge On

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
0
Sly Gryphon On

There is a partial work around with Windows, which implements local link default scope.

e.g. If you enter just "http://[fe80::1]" (or whatever your target is) into a browser in Windows, provided the destination you want is on the default interface, then it will work. The specifications allow for a missing scope (or scope "%0") to be treated as a default, but it is implementation dependent.

This also requires the default to be the network you want, doesn't support alternative scopes (you still can't use "%x" in the URL), and doesn't work on Linux, etc.

Example: Accessing my local router (http://[fe80::1]) from Chrome on Windows:

Screen shot of local link address working on Windows