I'm trying to ssh to some client behind a router that has a dynamic IPv6 address.
Directly using the public IPv6 address of the client works just fine.
Now, I'd like to dynamically construct the IPv6 address based on the hostname of the router and the IPv6 interface id of my client.
For example, let 2001:db8::
be my public prefix and the hostname's (example.com
) ip be 2001:db8::1319:8a2e:0370:7347
. Then, from the hostname I can find the current public prefix 2001:db8::
and together with the known IPv6 interface ID ::1319:8a2e:0370:7342
of my client I can build the public IPv6 address 2001:db8::1319:8a2e:0370:7342
even if the prefix changed in the meantime.
Is there a syntax for achieving that directly without some kind of external script?