Subject: Re: Host IDs
To: Al Snell <alaric@alaric-snell.com>
From: None <itojun@iijlab.net>
List: tech-kern
Date: 01/02/2001 11:51:54
>The IPv6 stuff like rtsol currently use MAC addresses to make "host
>identifiers" for IPv6 addresses.
>
>Would it be good to have a centralised kernel 64-bnit variable, "host ID",
>which is (by default) computed from the MAC address of what appears to be
>"the primary interface" according to the IEEE rules, but can be
>overridden?
>
>I ask because I'm setting up an IPv6 network and I don't want to have to
>update DNS and so on if machine MAC addresses change. I'd give my machines
>locally unique IDs based upon their hostnames (which should be an option
>for the "host ID" sysctl - set it up from a MAC address, from the
>last N chars of the hostname, etc).
normally,
- if you want to manually configure (like routers), you can assign
manually configured global address and put that onto the DNS.
there should be no need for changing link-local address.
# ifconfig ne0 inet6 3ffe:501:ffff:ffff::1 prefixlen 64 alias
- if you want to autoconfigure, dynamic DNS should be deployed :-)
solution 1:
there's some code for using MD5(hostname) as IPv6 interface ID,
for nodes without MAC/EUI64 address sources (like ppp-only machines).
if you really really want the behavior, you can put "return -1" at the
head of sys/netinet6/in6_ifattach.c:get_hw_ifid().
note that MD5(hostname) is *not* guaranteed to be unique, so you may
have trouble with conflicts.
solution 2:
remove link-local address, and add a new one, before using rtsol.
# ifconfig ne0 inet6 fe80::9876:5432:1234:5678%ne0 -alias
# ifconfig ne0 inet6 fe80::1111:1111:1111:1111%ne0 prefixlen 64 alias
i do not recommend it, as it can have strange interaction with
multicast group management.
solution 3:
if you just want the reverse database to meet the forward database,
you can do something like this.
for all ethernet cards you have, generate the following DNS zone file:
---
8.7.6.5.4.3.2.1.2.3.4.5.6.7.8.9 IN PTR 9876543212345678.itojun.org.
---
for all subnets you have, use the zone file as the database.
---
zone "e.f.f.f.f.f.f.f.1.0.5.0.e.f.f.3.ip6.int" {
type master;
file "interfaceid.rev";
};
zone "f.f.f.f.f.f.f.f.1.0.5.0.e.f.f.3.ip6.int" {
type master;
file "interfaceid.rev";
};
---
populate forward zone as necessary.
---
mynote.itojun.org. IN AAAA 3ffe:501:ffff:ffff:9876:5432:1234:5678
9876543212345678.itojun.org. IN AAAA 3ffe:501:ffff:ffff:9876:5432:1234:5678
---
itojun