Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I access the web server or website using link local IPv6 address?

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

Ethernet adapter Local Area Connection:

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

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?

like image 615
Ritesh Agarwal Avatar asked Jul 16 '15 06:07

Ritesh Agarwal


3 Answers

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.

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.

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

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.

like image 92
kasperd Avatar answered Jan 03 '23 21:01

kasperd


You can access it using curl as:

curl -6 -g --interface eth0 "http://[e80::f85b:4256:ee76:24a4]:8080" -vvv

like image 37
SaurabhJinturkar Avatar answered Jan 03 '23 20:01

SaurabhJinturkar


Most browsers don't support that, and even if they did you would have to use a URL like http://[fe80::f85b:4256:ee76:24a4%eth0]/ where eth0 is the identifier of the link on the client system, and so can be different for each client.

Better to use routable IPv6 address.

like image 24
Sander Steffann Avatar answered Jan 03 '23 20:01

Sander Steffann