Solved trouble with IPv6 aliases

dvl@

Developer
I have IPv6 and IP4 working as expected on FreeBSD 13.1 - but I can't get IPv6 aliases working. IP4 aliases are good. I'm at the point where I"m going to go through /etc/rc.conf commenting out things to see what's wrong.

EDIT: this just in, apparently I should use ifconfig_igb0_ipv6_alias0 - initial tests are good. It's late, I'll come back to this.

EDIT2: No, that did not resolve the issue. I spent the past few hours going through my entire configuration trying to isolate the problem. The problem is fixed, but I'm not sure of the cause.

Code:
[r720-02 dan ~] % egrep -i 'ifconfig|ipv6' /etc/rc.conf
ifconfig_igb0="inet 173.228.145.170 netmask 255.255.255.248"
ifconfig_igb0_ipv6="inet6 2610:1c0:2000:11:c94e:eea5:e1da:c49b prefixlen 64"
ipv6_network_interfaces="all"
ipv6_defaultrouter="2610:1c0:2000:11::1"
ifconfig_igb0_alias0="inet 10.140.0.217/32"
ifconfig_igb0_alias1="inet6 2610:1c0:2000:11::100 prefixlen 64"
ifconfig_igb0_alias2="inet6 2610:1c0:2000:11::deaa/64"

After reboot (or more precisely, service netif restart && service routing restart, we have

Code:
[r720-02 dan ~] % ifconfig igb0
igb0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=4e507bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,NOMAP>
    ether bc:30:5b:f9:2d:c0
    inet6 fe80::be30:5bff:fef9:2dc0%igb0 prefixlen 64 scopeid 0x1
    inet6 2610:1c0:2000:11:c94e:eea5:e1da:c49b prefixlen 64
    inet 173.228.145.170 netmask 0xfffffff8 broadcast 173.228.145.175
    inet 10.140.0.217 netmask 0xffffffff broadcast 10.140.0.217
    media: Ethernet autoselect (1000baseT <full-duplex>)
    status: active
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

I've tried rc_debug="YES" and didn't get any clues there. When I started this, I did have one alias working, but repeated attempts to trying to locate a clue have left me with the above.

thanks.
 
Last edited:
With the danger of stating the obvious, normally with rc_debug="YES" & rc_info="YES" you can see the execution of the specific "ifconfig" commands.
grep ifconfig in /var/log/messages & /var/log/console should in general show what's going on, also success/errors.
If a specific rc.conf "command" does not work as expected (maybe here) sometimes i use as workaround adding the wanted ifconfig commands explicitly to rc.local.
If a specific /usr/local/etc/rc.d command depends on it you can add "local" to the "# require" as workaround.
From man ifconfig,
Code:
ifconfig em0 inet6 2001:db8:bdbd::123 prefixlen 48 alias
 
I have no idea why it's working now, nor any idea why it was not working before.
 
Heisenbug (lol)
Sometimes one wrong character at one wrong place can be sufficient, with your eyes&mind filtering the wrongness out.
 
Heisenbug (lol)
Sometimes one wrong character at one wrong place can be sufficient, with your eyes&mind filtering the wrongness out.
I still have grabbed a copy from a snapshot, should I ever wish to compare:
Code:
[r720-02 dan /.zfs/snapshot] % sudo cp autosnap_2023-02-08_00:00:03_daily/etc/rc.conf /etc/rc.conf.2023-02-08
[r720-02 dan /.zfs/snapshot] % sudo cp autosnap_2023-02-08_00:00:03_daily/etc/rc.conf.local /etc/rc.conf.local.2023-02-08
[r720-02 dan /.zfs/snapshot] %
 
I think the problem is this line:

Code:
ipv6_network_interfaces="all"

Working with this configuration:

Code:
% egrep -e 'inet6|ipv6' rc.conf
ipv6_activate_all_interfaces="YES"
ifconfig_igb0_ipv6="inet6 2610:1c0:2000:11:c94e:eea5:e1da:c49b prefixlen 64"
ipv6_network_interfaces="all"
ipv6_defaultrouter="2610:1c0:2000:11::1"
ifconfig_igb0_alias0="inet6 2610:1c0:2000:11:8a8b:cf57:2c48:370d prefixlen 64"
ifconfig_igb0_alias3="inet6 2610:1c0:2000:11:8870:201b:27b5:f4f2 prefixlen 64"

When that line is commented out, I get:

Code:
[r720-02 dan ~] % ifconfig igb0 | grep inet6
    inet6 fe80::be30:5bff:fef9:2dc0%igb0 prefixlen 64 scopeid 0x1
    inet6 2610:1c0:2000:11:8a8b:cf57:2c48:370d prefixlen 64
    inet6 2610:1c0:2000:11:8870:201b:27b5:f4f2 prefixlen 64
    inet6 2610:1c0:2000:11:c94e:eea5:e1da:c49b prefixlen 64
[r720-02 dan ~] %

When active, I get:
Code:
[r720-02 dan ~] % ifconfig igb0 | grep inet6
    inet6 fe80::be30:5bff:fef9:2dc0%igb0 prefixlen 64 scopeid 0x1
    inet6 2610:1c0:2000:11:c94e:eea5:e1da:c49b prefixlen 64
[r720-02 dan ~] %
 
Well the manpage says that ipv6_network_interfaces is the equivalent of network_interfaces and normally manual configuration of this variable is not needed.

Looking at the network_interfaces, we are told that setting it to anything other than the default is deprecated.
I didn't bother reading further, but I think that's a fair assessment.
 
I think the problem is this line:

Code:
ipv6_network_interfaces="all"

You might have been trying to achieve the same result as with "AUTO" (the default); rc.conf(5) ("network_interfaces"); or perhaps you were thinking of "ipv6_activate_all_interfaces", rc.conf(5):
Code:
ipv6_activate_all_interfaces
		 (bool)	This controls initial configuration on IPv6-capable
		 interfaces with no corresponding ifconfig_<interface>_ipv6
		 variable.  Note that it is not	always necessary to set	this
		 variable to "YES" to use IPv6 functionality on	FreeBSD.  In
		 most cases, just configuring ifconfig_<interface>_ipv6	vari-
		 ables works.
 
ipv6_activate_all_interfaces is in use above.

I'll try removing that setting and see what happens. Right after I get back from a trip to the grocery store. On a Sunday, just a few hours before the Super Bowl. If I'm not back in an hour, please look after my servers for me.
 
You might have been trying to achieve the same result as with "AUTO" (the default); rc.conf(5) ("network_interfaces"); or perhaps you were thinking of "ipv6_activate_all_interfaces", rc.conf(5):
Code:
ipv6_activate_all_interfaces
         (bool)    This controls initial configuration on IPv6-capable
         interfaces with no corresponding ifconfig_<interface>_ipv6
         variable.  Note that it is not    always necessary to set    this
         variable to "YES" to use IPv6 functionality on    FreeBSD.  In
         most cases, just configuring ifconfig_<interface>_ipv6    vari-
         ables works.
The store was not as crowded as I feared. Ice cream obtained.

I have rebooted the server with this directive commented out: #ipv6_activate_all_interfaces="YES"

All is well. :) I have aliases as expected. For the record, these are my settings now:

Code:
[r720-02 dan ~] % egrep -i 'ifconfig|ipv6' /etc/rc.conf
ifconfig_igb0="inet 173.228.145.170 netmask 255.255.255.248"
ifconfig_igb0_ipv6="inet6 2610:1c0:2000:11:c94e:eea5:e1da:c49b prefixlen 64"
ipv6_defaultrouter="2610:1c0:2000:11::1"
ifconfig_igb0_alias0="inet 10.140.0.217/32"
ifconfig_igb0_alias1="inet 173.228.145.171/32"
ifconfig_igb0_alias2="inet6 2610:1c0:2000:11:8870:201b:27b5:f4f2 prefixlen 64"
ifconfig_igb0_alias3="inet6 2610:1c0:2000:11:8a8b:cf57:2c48:370d prefixlen 64"
[r720-02 dan ~] %
 
With the danger of stating the obvious, normally with rc_debug="YES" & rc_info="YES" you can see the execution of the specific "ifconfig" commands.
grep ifconfig in /var/log/messages & /var/log/console should in general show what's going on, also success/errors.
If a specific rc.conf "command" does not work as expected (maybe here) sometimes i use as workaround adding the wanted ifconfig commands explicitly to rc.local.
If a specific /usr/local/etc/rc.d command depends on it you can add "local" to the "# require" as workaround.
From man ifconfig,
Code:
ifconfig em0 inet6 2001:db8:bdbd::123 prefixlen 48 alias
I did try rc_debug="YES" but not rc_info="YES" - I did not see any clues.
 
Back
Top