Skip to content

IPv6 notes

mdavidsaver edited this page Sep 27, 2021 · 5 revisions

Terminology

rfc7346 talks about "interface-local" scope. In Linux source this is referred to as "node-local". Both refer to scope 1. cf. IPV6_ADDR_SCOPE_NODELOCAL in kernel source.

Gotchas...

Magic link-local address

With Linux, the automatic link-local address (fe80::...) doesn't appear until the link becomes RUNNING for the first time. eg. for a TAP interface, after something open()s it.

mcast on loopback

Trying to send to ff01::1:ff00:1 or ff02::1:ff00:1 via the loopback interface. Set interface index 1 via IPV6_MULTICAST_IF and/or sin6_scope_id.

Does not seem to be possible with defaults. Roadblocks...

  • IPV6_ADD_MEMBERSHIP fails unless lo has IFF_MULTICAST. workaround:
# ip link show dev lo
1: lo: <LOOPBACK,MULTICAST,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
# ip link set dev lo multicast on
  • sendto() fails with EHOSTUNREACH

There is no default entry for lo in the multicast routing table. workaround?

# ip route show type multicast table all
multicast ff00::/8 dev br0 table local proto kernel metric 256 pref medium
multicast ff00::/8 dev wlan0 table local proto kernel metric 256 pref medium
# ip route add multicast ff00::/8 dev lo table local
  • sendto() succeeds, but no packet is sent. stuck here...

Based on investigation of sendto() call chain with systemtap, looks like a blackhole route is selected? (call to ip6_pkt_discard_out() instead of ip6_output()) Maybe unable to select a source address?

Clone this wiki locally