Re: IPv6: How does one have the system use a prefix gotten from rtsol with a static host part?

From: Larry Rosenman <ler_at_lerctr.org>
Date: Sat, 12 Mar 2022 07:52:35 UTC
*From: *Kevin Oberman <rkoberman@gmail.com>
*To: *Larry Rosenman <ler@lerctr.org>
*CC: *Hajimu UMEMOTO <ume@mahoroba.org>; Michael Sierchio <kudzu@tenebras.com>; Freebsd net <freebsd-net@freebsd.org>
*Date: *Mar 12, 2022 1:18:07 AM
*Subject: *Re: IPv6: How does one have the system use a prefix gotten from rtsol with a static host part?

> On Fri, Mar 11, 2022 at 8:00 PM Larry Rosenman <ler@lerctr.org> wrote:
>> On 03/11/2022 9:36 pm, Hajimu UMEMOTO wrote:
>>> Hi,
>>>
>>> On Sat, 12 Mar 2022 20:47:10 +0900, Larry Rosenman wrote:
>>>
>>>> > Something like this should work for you:
>>>> >
>>>> >   ifconfig_eth0_ipv6="inet6 fe80::53:1 -auto_linklocal accept_rtadv"
>>>>
>>>> Nope, didn't work on my home net:
>>>
>>> It's strange to me.
>>> That setting is actually working on my box.
>>>
>>>> ❯ ifconfig bce0
>>>> bce0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu
>>>> 1500
>>>>      options=c01bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,VLAN_HWTSO,LINKSTATE>
>>>>      ether a4:ba:db:29:66:95
>>>>      inet 192.168.200.4 netmask 0xfffffc00 broadcast 192.168.203.255
>>>>      inet 192.168.200.5 netmask 0xfffffc00 broadcast 192.168.203.255
>>>
>>>>      inet6 fe80::a6ba:dbff:fe29:6695%bce0 prefixlen 64 scopeid 0x2
>>>
>>> It seems -auto_linklocal is not working for you.
>>>
>>>>      inet6 fe80::53:1%bce0 prefixlen 64 scopeid 0x2
>>>>      inet6 2600:1700:210:b18f:a6ba:dbff:fe29:6695 prefixlen 64 autoconf
>>>>      media: Ethernet autoselect (1000baseT <full-duplex>)
>>>>      status: active
>>>>      nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
>>>>
>>>> grep bce0 /etc/rc.conf:
>>>> ifconfig_bce0="inet 192.168.200.4/22[http://192.168.200.4/22] "
>>>> ifconfig_bce0_alias0="inet 192.168.200.5/22[http://192.168.200.5/22] "
>>>> ifconfig_bce0_ipv6="inet6 fe80::53:1 accept_rtadv -auto_linklocal"
>>>
>>> I'm using DHCP for IPv4 address.
>>> When ifconfig_bce0_alias0 is set, it does not work.
>>> It seems that ifconfig_bce0_alias0 does up bce0 before set
>>> -auto_linklocal.
>>> After some testing, following setting works here.
>>>
>>> ifconfig_bce0="inet6 fe80::53:1 -auto_linklocal"
>>> ifconfig_bce0_alias0="inet 192.168.200.4/22[http://192.168.200.4/22]"
>>> ifconfig_bce0_alias1="inet 192.168.200.5/22[http://192.168.200.5/22]"
>>> ifconfig_bce0_ipv6="inet6 accept_rtadv"
>>>
>> Thank You so much.  That works here too.  I wonder if this deserves a
>> document somewhere?
>> It's NOT intuitively obvious that:
>> a) Order in /etc/rc.conf matters
>> b) the fe80 address influences the global address
> 
> I don't see how 'a' is possible. All rc.conf does is defne a bunch of environmental variables. I don't see any way the order is relevant other than that a later definition of a variable overriding an earlier one. What am I missing here?
Yeah, you're right.  But the other point about the fe80 address is not obvious.