Score:0

Construct public ipv6 adress from hostname of router and interface id of client

us flag
dba

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?

in flag
So you want to take the hostname of the router, get the IP for that hostname, grab probably the ::/64 and then apply the clients local part? Otherwise clarify in you question what you mean by "IPv6 interface id" and please use at least examples 2001:db8:: is available for documentation/examples
Ron Maupin avatar
us flag
Business networks are assigned fixed IPv6 prefixes. This is for a residential network where the IPv6 addressing changes to help prevent a ToS violation of running services to the public Internet from a residential network,
dba avatar
us flag
dba
@NiKiZe Yeah, that's what I want. I also added an example.
in flag
There is no standard here, you are making assumptions here.
Score:3
cn flag

Business class internet service should be providing a static IPv6 prefix. The address space is easily big enough to provide this for everyone.

DNS is the first choice for resolving names to IPs. Consider a DNS updating script, running on a box that knows the prefix. nsupdate, ddclient, something like that. A script to drive that is fairly simple: concatenate a /64 prefix plus interface ID.

Maybe store the prefix in DNS as well, so it can be retrieved by name.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.