Need help on IPv6 prefixes and interface addresses
Hartmut.Brandt at dlr.de
Hartmut.Brandt at dlr.de
Wed Nov 25 15:10:50 UTC 2009
To answer my own question :-) These strange link local addresses are explained in the developers handbook section 8.1.1.3 and are called embedded
link local addresses. These are not standard IPv6 addresses, but a way to encode the interface index (aka zone index) into the IPv6 address. This must be undone by the user program before using these addresses.
harti
-----Original Message-----
From: owner-freebsd-net at freebsd.org on behalf of Hartmut.Brandt at dlr.de
Sent: Wed 11/25/2009 1:15 PM
To: freebsd-net at freebsd.org
Subject: Need help on IPv6 prefixes and interface addresses
Hi all,
I try to make bsnmpd IPv6 aware and need some help here. I've set up a small IPv6 network for testing between a couple of VMs.
For IPv6 interface addresses there are two tables: ipAddressPrefix table and ipAddressTable (containing pointers to the prefix table). Now I see something on my system I cannot grasp. ndp -pn gives me:
2001:638:101:ff::/64 if=le0
flags=LO vltime=infinity, pltime=infinity, expire=Never, ref=1
No advertising router
fe80::%le0/64 if=le0
flags=LAO vltime=infinity, pltime=infinity, expire=Never, ref=0
No advertising router
fe80::%lo0/64 if=lo0
flags=LAO vltime=infinity, pltime=infinity, expire=Never, ref=0
No advertising router
ifconfig -a inet6 gives:
le0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8<VLAN_MTU>
inet6 fe80::20c:29ff:fe90:dd1b%le0 prefixlen 64 scopeid 0x1
inet6 2001:638:101:ff::8:ffff prefixlen 64
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
So far, so nice.
When I ask for the interface addresses via sysctl([0, NET_RT_IFLIST, 0], ...) I get strange RTM_NEWADDR messages:
msglen=76 version=5 type=RTM_NEWADDR
flags=0
index=1 metric=0
netmask=INET6,28,{0,0,ffff:ffff:ffff:ffff::,0}
ifa=INET6,28,{0,0,fe80:1::20c:29ff:fe90:dd1b,0}
Which means a prefix of fe80:1::/64 instead of fe80::%le0/64. Note, the :1: there and note the zero missing scope_id
(the last 0 inside the {}). Same for lo0:
msglen=80 version=5 type=RTM_NEWADDR
flags=0
index=2 metric=0
netmask=INET6,28,{0,0,ffff:ffff:ffff:ffff::,0}
ifa=INET6,28,{0,0,fe80:2::1,0}
brd=UNSPEC,0,{}
So my questions:
- are the routing message really that inconsistent and broken? Or do I read them somehow incorrect?
- is it possible to rely on the prefix table? In other words: Does *each* prefix used
in a INET6 interface address appear in the prefix list?
harti
_______________________________________________
freebsd-net at freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
More information about the freebsd-net
mailing list