Re: ipv6_addrs_IF aliases in rc.conf(5)

From: Kimmo Paasiala <kpaasial_at_gmail.com>
Date: Mon, 24 Dec 2012 06:07:03 +0200
On Sat, Dec 22, 2012 at 7:49 PM, Łukasz Wąsikowski
<lukasz_at_wasikowski.net> wrote:
> W dniu 2012-12-22 18:14, Ben Morrow pisze:
>> Quoth =?UTF-8?B?xYF1a2FzeiBXxIVzaWtvd3NraQ==?= <lukasz_at_wasikowski.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="up" and it worked. So it looks like this:
>>
>> 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="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="up".
>
> root_at_freebsd:~ # grep -Ev '^[[:space:]]*#|^$' /etc/rc.conf ; ifconfig
> em0 | grep -E '^[[:space:]]*inet6' | head -2
> hostname="freebsd"
> ifconfig_em0="up"
> ipv4_addrs_em0="192.168.168.20-24/24"
> defaultrouter="192.168.168.1"
> ipv6_network_interfaces="em0"
> ipv6_defaultrouter="2001:6a0:1cb::ffff"
> ifconfig_em0_ipv6="up"
> ipv6_addrs_em0="2001:6a0:1cb::1-e/128"
> sshd_enable="YES"
> dumpdev="NO"
> named_enable="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
Received on Mon Dec 24 2012 - 03:07:05 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:33 UTC