Mind Dump, Tech And Life Blog
written by Ivan Alenko
published under license CC4-BY
posted in category Systems Software / Networking
posted at 30. Oct '23

Using IPv6 To Connect To Local Network Devices

I used IPv6 to connect to my new second Turris Omnia, because I was lazy and had collision in IPv4 address space. It is easier to take a USB-C dongle, connect to it to a desktop computer and voila, I have two network interfaces without any hassles.

Yet, there are issues with IPv6, mostly my lack of knowledge and also small stupid stuff which are not on my side.

Show Known Devices On a Network

$ ip -6 neigh show
fe80::da58:d7ff:fe01:e0bb dev enp5s0 FAILED 
fe80::da58:d7ff:fe01:ceb dev enp5s0 lladdr d8:58:d7:01:0c:eb router STALE 
fdad:a2a5:25e1::1 dev enx00e04c6803fd lladdr d8:58:d7:01:e0:bb router REACHABLE 
fe80::da58:d7ff:fe01:e0bb dev enx00e04c6803fd lladdr d8:58:d7:01:e0:bb router STALE 

TODO: how to refresh stale entries and discover router/other devices?

Connect to fe80:: in Web Browser

Forget it.

While every IPv6 autoconfigures to some link local address fe80::, like fe80::da58:d7ff:fe01:e0bb, Firefox and Chromium will refuse to connect.

Solution: assign another link local address via DHCPv6 (see below how to do it).

TODO: there should be another way. Find it.

Ping IPv6 Address

You have to use network interface along with IPv6 address.

BAD:

$ ping fe80::da58:d7ff:fe01:e0bb
PING fe80::da58:d7ff:fe01:e0bb(fe80::da58:d7ff:fe01:e0bb) 56 data bytes
From fe80::4eed:fbff:fe72:b2ee%enp5s0 icmp_seq=1 Destination unreachable: Address unreachable
From fe80::4eed:fbff:fe72:b2ee%enp5s0 icmp_seq=2 Destination unreachable: Address unreachable
From fe80::4eed:fbff:fe72:b2ee%enp5s0 icmp_seq=10 Destination unreachable: Address unreachable
^C
--- fe80::da58:d7ff:fe01:e0bb ping statistics ---
10 packets transmitted, 0 received, +10 errors, 100% packet loss, time 9222ms

GOOD:

aaa@rapthalia:~$ ping fe80::da58:d7ff:fe01:e0bb%enx00e04c6803fd
PING fe80::da58:d7ff:fe01:e0bb%enx00e04c6803fd(fe80::da58:d7ff:fe01:e0bb%enx00e04c6803fd) 56 data bytes
64 bytes from fe80::da58:d7ff:fe01:e0bb%enx00e04c6803fd: icmp_seq=1 ttl=64 time=0.854 ms
64 bytes from fe80::da58:d7ff:fe01:e0bb%enx00e04c6803fd: icmp_seq=2 ttl=64 time=0.824 ms
64 bytes from fe80::da58:d7ff:fe01:e0bb%enx00e04c6803fd: icmp_seq=3 ttl=64 time=0.834 ms
^C
--- fe80::da58:d7ff:fe01:e0bb%enx00e04c6803fd ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2057ms
rtt min/avg/max/mdev = 0.824/0.837/0.854/0.012 ms

Curl IPv6 Address

curl [fe80::da58:d7ff:fe01:e0bb%enx00e04c6803fd]

Should work. And return HTML.

Use DHCPv6

Funnily enough, the assigned address is not in the output, just a prefix or subnet (TODO: what is 6f8?) fdad:a2a5:25e1::6f8. The address is fdad:a2a5:25e1::1, so now I can use Firefox to connect to http://[fdad:a2a5:25e1::1]/. Brackets are needed, network interface not.

Then I set a static IPv4 address and connected it to a router and turned off DHCPv6….so I don’t have information how to do it again without.

root@rapthalia:~# dhclient -6 -v enx00e04c6803fd
Internet Systems Consortium DHCP Client 4.4.3-P1
Copyright 2004-2022 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on Socket/enx00e04c6803fd
Sending on   Socket/enx00e04c6803fd
Created duid "\000\001\000\001,\253AO\000\340Lh\003\375".
PRC: Soliciting for leases (INIT).
XMT: Forming Solicit, 0 ms elapsed.
XMT:  X-- IA_NA 4c:68:03:fd
XMT:  | X-- Request renew in  +3600
XMT:  | X-- Request rebind in +5400
XMT: Solicit on enx00e04c6803fd, interval 1060ms.
RCV: Advertise message on enx00e04c6803fd from fe80::da58:d7ff:fe01:e0bb.
RCV:  X-- IA_NA 4c:68:03:fd
RCV:  | X-- starts 1696105680
RCV:  | X-- t1 - renew  +21600
RCV:  | X-- t2 - rebind +34560
RCV:  | X-- [Options]
RCV:  | | X-- IAADDR fdad:a2a5:25e1::6f8
RCV:  | | | X-- Preferred lifetime 43200.
RCV:  | | | X-- Max lifetime 43200.
RCV:  X-- Server ID: 00:03:00:01:d8:58:d7:01:e0:bb
RCV:  Advertisement recorded.
PRC: Selecting best advertised lease.
PRC: Considering best lease.
PRC:  X-- Initial candidate 00:03:00:01:d8:58:d7:01:e0:bb (s: 10104, p: 0).
XMT: Forming Request, 0 ms elapsed.
XMT:  X-- IA_NA 4c:68:03:fd
XMT:  | X-- Requested renew  +3600
XMT:  | X-- Requested rebind +5400
XMT:  | | X-- IAADDR fdad:a2a5:25e1::6f8
XMT:  | | | X-- Preferred lifetime +7200
XMT:  | | | X-- Max lifetime +7500
XMT:  V IA_NA appended.
XMT: Request on enx00e04c6803fd, interval 940ms.
RCV: Reply message on enx00e04c6803fd from fe80::da58:d7ff:fe01:e0bb.
RCV:  X-- IA_NA 4c:68:03:fd
RCV:  | X-- starts 1696105681
RCV:  | X-- t1 - renew  +21600
RCV:  | X-- t2 - rebind +34560
RCV:  | X-- [Options]
RCV:  | | X-- IAADDR fdad:a2a5:25e1::6f8
RCV:  | | | X-- Preferred lifetime 43200.
RCV:  | | | X-- Max lifetime 43200.
RCV:  X-- Server ID: 00:03:00:01:d8:58:d7:01:e0:bb
PRC: Bound to lease 00:03:00:01:d8:58:d7:01:e0:bb.

But yeah, for now, this is the end of this very useful information.

Add Comment