0

I have the following scenario: Using an old PC behind a Fritzbox-Router, I wanted to setup several small services using docker. The Fritzbox requires my PC to have an static interface-address for the portforwarding-stuff to work. But whenever I reboot said PC the ipv6-interface part seems to alternate between two sepparate interfaces. One is the xxxx:xxxx:f6d1:cbfa (which was already the standard-interface inside the fritz-box) and the other one is the part xxxx:xxxx:fe08:f24 (which seems to be some sort of a local-ip inside the network based on the fe80-addresses).
Now my specific question is how to convice Ubuntu 22.04 to behave like a good system and always use the xxxx:xxxx:f6d1:cbfa as it's interface-ip-part? Is there some sort of config file?
Thanks in advance.

Husky110
  • 103
  • 2
  • https://linuxconfig.org/how-to-configure-static-ip-address-on-ubuntu-22-04-jammy-jellyfish-desktop-server – gapsf Sep 03 '22 at 07:13

1 Answers1

1

IPv6 has a few choices for how to do stable IP addresses. Defining a static interface ID on the host. DHCPv6 where reservations persist. And a value that can be computed from known values, like EUI-64 based on layer 2 address. Assuming you want static host IDs.

Tokenised IPv6 identifiers is user provided lower 64 bits tacked onto the existing /64 prefix. Should make prefix changes easier. Linux iproute has an implementation, man ip token. But on Linux things are overly complicated and there are competing network managers to choose from to make the features reasonable to use.

With netplan this is device property ipv6-address-token

  ethernets:
    eth0:
      ipv6-address-token: "::f6d1:cbfa"

systemd-networkd is of the form Token=static::f6d1:cbfa

NetworkManager would be setting ipv6.token to ::f6d1:cbfa

And just for fun, on Gentoo could put ip token set ::f6d1:cbfa dev eth0 in a postup() hook.


xxxx:xxxx:fe08:f24 (which seems to be some sort of a local-ip inside the network based on the fe80-addresses).

fe80::/10 is link local. In other words, when the most significant digits are fe8.

The digit sequence "fe" can and will appear in the rest of the address, but this does not require the address to have anything to do with link local. 2001:db8::fe80:f24 is global unicast, for example.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32