0

I have a device that is accessible via IPv6: https://[fe80::xxxx:xxxx:xxxx ]/

The network is quite simple, just a basic switch, no router. With a Windows computer, I can access the above address in Chrome.

With my MacBook, it doesn't work in either Safari or Chrome. When I send a ping, I don't get a response. However, when I send a ping specifying the interface, I get a response: fe80::xxxx:xxxx:xxxx %en6

I tried including %en6 in the browser, but that doesn't work either.

In the network settings on macOS, IPv6 is set to Automatic.

What could be the cause? Both computers are connected to the same switch. The switch is not managed or anything like that.

1 Answer 1

1

You need to explicitly specify the zone ID in order to tell the network stack which interface to make the connection via (I don't know why macOS doesn't set a reasonable default, but... it doesn't). There's no sane way to do this (that I know of, anyway), but there is a kluge that'll get it done. First, find the numeric (hexadecimal) zone (/scope) ID of your primary network interface with ifconfig <interfacename>. You should get something like this:

% ifconfig en0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=6460<TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
    ether f8:ff:c2:b5:02:11
    inet6 fe80::68:e021:8a0b:3d38%en0 prefixlen 64 secured scopeid 0x5 
    [...]

The thing you need here is the "scopeid" at the end, but without the "0x" prefix -- it's 5 in this example.

Add that ID number to the IPv6 address as the second 16-bit word, i.e. fe80::xxxx:xxxx:xxxx -> fe80:5::xxxx:xxxx:xxxx, and use that in the url, like https://[fe80:5::xxxx:xxxx:xxxx ]/.

The reason this works is that BSD-based network stacks (like macOS') use the second word internally to represent the interface/zone ID, and you can take advantage of this to sneak a zone ID past parsers that don't allow them to be specified the normal way.

BTW, there's apparently an effort underway to officially support zone IDs in URLs, but it's not there yet. See RFC6874 (especially page 5). Note that this has been a problem for a long time, see this Firefox "bug" entry dating back 13 years!

4
  • OUTPUT: 169.254 link#11 UCS en0 AND 169.254 link#22 UCSI en6 EN6 is the interface where the device is connected. But still no response with https://[fe80:11::xxxx:xxxx:xxxx ]/. or https://[fe80:22::xxxx:xxxx:xxxx ]/. Commented May 26 at 8:45
  • ok i got it! Not the link# number needs to be placed there, but the scope ID. I can see this when I check with ifconfig en6. Commented May 26 at 8:55
  • @MichaelMitch Interesting, I hadn't seen it be different from the link # before. I'll update my answer for future readers Commented May 26 at 23:47
  • The Magic is.. #22 is 0x16 in hex:) Commented May 28 at 3:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .