Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Dec 2012 11:33:02 +0200
From:      Kimmo Paasiala <kpaasial@gmail.com>
To:        freebsd-stable@freebsd.org, FreeBSD current <freebsd-current@freebsd.org>
Subject:   Re: ipv6_addrs_IF aliases in rc.conf(5)
Message-ID:  <CA%2B7WWSfx2UO=yC25aaSWeGVPr2qtr-dkumH8Jxa7BiY7Xqarng@mail.gmail.com>
In-Reply-To: <CA%2B7WWSdUFc1Xp-KikDjk2yRHP7S41Uxy3SdOrKZyP%2BcR7mp0KA@mail.gmail.com>
References:  <50D1C553.9060100@wasikowski.net> <CA%2B7WWSewg%2BQqcn1L508tAiBY1zLQfne6AC6w7oAco3y=efcX9w@mail.gmail.com> <CA%2B7WWSeibFGNSwtjUeK-U6irj6axGftAHJC2eYU3tQoeM0JRpA@mail.gmail.com> <20121220132750.GB99616@stack.nl> <CA%2B7WWSdqjkZq1y0dyxV9LiycNA0V%2BCyEKt9x0d%2BWJaaWC4SXSg@mail.gmail.com> <CA%2B7WWSc-VwdmYBEtZwO03x-p2o7-eUr9bWrhMhjBCUSah_0v_A@mail.gmail.com> <50D4F2E4.7020600@wasikowski.net> <CA%2B7WWSc9sR74RT=oMT8uSBmNYrK-80t7Y8KKZx9JxuVE4drXBA@mail.gmail.com> <CA%2B7WWSdM=45i5knYHUa_Nq=2dta4ek8Q%2Bp3g_Bf697d7_i__QA@mail.gmail.com> <CA%2B7WWSc9ORJQnvaVA0QVnwf4i=wEJ-%2BcYiOqQK3wDUDzL=TGTA@mail.gmail.com> <20121222171400.GA2399@anubis.morrow.me.uk> <50D5F296.9050109@wasikowski.net> <CA%2B7WWSdUFc1Xp-KikDjk2yRHP7S41Uxy3SdOrKZyP%2BcR7mp0KA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 24, 2012 at 6:07 AM, Kimmo Paasiala <kpaasial@gmail.com> wrote:
> On Sat, Dec 22, 2012 at 7:49 PM, =C5=81ukasz W=C4=85sikowski
> <lukasz@wasikowski.net> wrote:
>> W dniu 2012-12-22 18:14, Ben Morrow pisze:
>>> Quoth =3D?UTF-8?B?xYF1a2FzeiBXxIVzaWtvd3NraQ=3D=3D?=3D <lukasz@wasikows=
ki.net>:
>>>> W dniu 2012-12-22 04:41, Kimmo Paasiala pisze:
>>>>
>>>>> Yeah, this is problem in network.subr. An interface is not recognized
>>>>> as IPv6 capable if the interface is not in "ipv6_network_interfaces"
>>>>> and there's no "ifconfig_IF_ipv6" in rc.conf(5), bummer. For IPv4 it
>>>>> "just works" because the interface is always assumed to be IPv4
>>>>> capable.
>>>>
>>>> Ok, I used ifconfig_em0_ipv6=3D"up" and it worked. So it looks like th=
is:
>>>
>>> The documented way to do this is to just set the link-local address in
>>> ifconfig_IF_ipv6, since an interface is required to have a link-local
>>> address. Either configure an fe80:: address explicitly or set
>>>
>>>     ifconfig_em0_ipv6=3D"inet6 auto_linklocal"
>>>
>>> Alternatively, if you set ipv6_activate_all_interfaces all interfaces
>>> will be considered IPv6-capable.
>>
>> link-local address is assigned by default, even with ifconfig_IF_ipv6=3D=
"up".
>>
>> root@freebsd:~ # grep -Ev '^[[:space:]]*#|^$' /etc/rc.conf ; ifconfig
>> em0 | grep -E '^[[:space:]]*inet6' | head -2
>> hostname=3D"freebsd"
>> ifconfig_em0=3D"up"
>> ipv4_addrs_em0=3D"192.168.168.20-24/24"
>> defaultrouter=3D"192.168.168.1"
>> ipv6_network_interfaces=3D"em0"
>> ipv6_defaultrouter=3D"2001:6a0:1cb::ffff"
>> ifconfig_em0_ipv6=3D"up"
>> ipv6_addrs_em0=3D"2001:6a0:1cb::1-e/128"
>> sshd_enable=3D"YES"
>> dumpdev=3D"NO"
>> named_enable=3D"YES"
>>         inet6 fe80::a00:27ff:fe02:8371%em0 prefixlen 64 scopeid 0x1
>>         inet6 2001:6a0:1cb::1 prefixlen 128
>>
>> Of course using "inet6 auto_linklocal" instead of "up" seems a better
>> way to do it, thank you for this tip.
>>
>> --
>> best regards,
>> Lukasz Wasikowski
>
>
> I have put up the patch at github as:
>
> https://gist.github.com/4362018
>
> This version should work with just the ipv6_addrs_IF in rc.conf(5). I
> changed the detection of ipv6 interfaces so that just having the
> ipv6_addrs_IF line is enough.
>
> -Kimmo

I've revised the patch again and updated it at gihub,
https://gist.github.com/4362018.  It can now be applied at top level
of sources (/usr/src typically). It now does the deconfiguration in
reverse order of the configuration, meaning the aliases configured
with ipv6_addrs_IF are removed before the ones configured with
ifconfig_IF_aliasN=3D"inet6 ...".

Also as noted in my previous message it's possible to configure all
IPv6 addresses with a single ipv6_addrs_IF line in rc.conf:

ipv6_addrs_re0=3D"2001:db8:1111:2222::1-4/64"


I consider this version of the patch pretty much completed work. It
applies cleanly to HEAD version r244694 and I don't see why it
wouldn't work in HEAD as well.

Now, is there any interest in seeing this feature as part of future
versions of FreeBSD? Could it be incorporated to HEAD and then MFC'ed
to 9-STABLE  if it turns out it's seen as a useful feature?

Regards,

Kimmo Paasiala



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B7WWSfx2UO=yC25aaSWeGVPr2qtr-dkumH8Jxa7BiY7Xqarng>