Solved Add additional IPv6 addresses to a tagged vlan

I am having a hard time figuring out how to add additional IPv6 addresses to a tagged vlan in rc.conf on FreeBSD v12.1.

/etc/rc.conf (not working):

Code:
# Define vlan
vlans_igb0="3005"
# Set first IP
ifconfig_igb0_3005="inet6 2604:86c0:2000:6::2/64"
# Fail 1
ifconfig_igb0_3005_alias0="inet6 2604:86c0:2000:6::3/64"
# Fail 2
ifconfig_igb0_3005_aliases="\
  inet6 2604:86c0:2000:6::3/64\
  inet6 2604:86c0:2000:6::4/64\
  inet6 2604:86c0:2000:6::5/64\
  inet6 2604:86c0:2000:6::6/64\
  inet6 2604:86c0:2000:6::7/64\
  inet6 2604:86c0:2000:6::8/64\
  inet6 2604:86c0:2000:6::9/64\
"
# Fail 3
ifconfig_igb0_3005="inet6 2604:86c0:2000:6::3/64"
# Route
ipv6_defaultrouter="2604:86c0:2000:6::1"

Neither the ifconfig_igb0_3005_alias0 nor the ifconfig_igb0_3005_aliases nor adding another ifconfig_igb0_3005="inet6 2604:86c0:2000:6::3/64" works. The last option overwrites the primary ::2 entry.

But I can run: ifconfig igb0.3005 inet6 2604:86c0:2000:6::4/64 on the command line and the alias is added.

How does one add this to rc.conf?
 
Code:
ifconfig_igb0_3005="inet 1.2.3.4 netmask 255.255.255.0"
ifconfig_igb0_3005_alias0="inet 5.6.7.8 netmask 255.255.255.0"
ifconfig_igb0_3005_ipv6="inet6 2604:86c0:2000:6::2/64"
ifconfig_igb0_3005_ipv6_alias0="inet6 ...."
Notice the difference?
 
Doesn't seem to work:

/etc/rc.conf
Code:
vlans_igb0="3005"
ifconfig_igb0_3005_ipv6="inet6 2604:86c0:2000:6::2/64"
ifconfig_igb0_3005_ipv6_alias0="inet6 2604:86c0:2000:6::3/64"
ipv6_defaultrouter="2604:86c0:2000:6::1"
service netif restart && service routing restart
ifconfig igb0.3005
Code:
igb0.3005: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=600703<RXCSUM,TXCSUM,TSO4,TSO6,LRO,RXCSUM_IPV6,TXCSUM_IPV6>
    ether 0c:c4:7a:42:85:98
    inet6 2604:86c0:2000:6::2 prefixlen 64
    inet6 fe80::ec4:7aff:fe42:8598%igb0.3005 prefixlen 64 scopeid 0x4
    groups: vlan
    vlan: 3005 vlanpcp: 0 parent interface: igb0
    media: Ethernet autoselect (1000baseT <full-duplex>)
    status: active
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

It does not add the second IP for some reason. I am assuming it does not require a reboot and restarting netif should work.

Here it is working on the command line:

ifconfig igb0.3005 inet6 2604:86c0:2000:6::3/64
ifconfig igb0.3005
Code:
igb0.3005: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=600703<RXCSUM,TXCSUM,TSO4,TSO6,LRO,RXCSUM_IPV6,TXCSUM_IPV6>
    ether 0c:c4:7a:42:85:98
    inet6 2604:86c0:2000:6::2 prefixlen 64
    inet6 fe80::ec4:7aff:fe42:8598%igb0.3005 prefixlen 64 scopeid 0x4
    inet6 2604:86c0:2000:6::3 prefixlen 64
    groups: vlan
    vlan: 3005 vlanpcp: 0 parent interface: igb0
    media: Ethernet autoselect (1000baseT <full-duplex>)
    status: active
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
 
ifconfig_igb0_3005_ipv6="inet6 2604:86c0:2000:6::2/64"
ifconfig_igb0_3005_alias0="inet6 2604:86c0:2000:6::3/64"

Don't put ipv6 in front of alias0

ifconfig_<interface>_ipv6
(str) IPv6 functionality on an interface should be configured
by ifconfig_<interface>_ipv6, instead of setting ifconfig pa-
rameters in ifconfig_<interface>. If this variable is empty,
all of IPv6 configurations on the specified interface by
other variables such as ipv6_prefix_<interface> will be ig-
nored.


Aliases should be set by ifconfig_<interface>_alias<n> with
"inet6" keyword. For example:

ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64"
ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64"

p.s.
i just realize that the man page is wrong

Aliases should be set by ifconfig_<interface>_alias<n> with without
"inet6" keyword.

 
Thank you VladiBG!

That worked. Here is my final solution:
/etc/rc.conf
Code:
# IPv6
vlans_igb0="3005"
ifconfig_igb0_3005_ipv6="inet6 2604:86c0:2000:6::2/64"
ipv6_defaultrouter="2604:86c0:2000:6::1"
ifconfig_igb0_3005_aliases="\
  inet6 2604:86c0:2000:6::3/64\
  inet6 2604:86c0:2000:6::4/64\
  inet6 2604:86c0:2000:6::5/64\
  inet6 2604:86c0:2000:6::6/64\
  inet6 2604:86c0:2000:6::7/64\
  inet6 2604:86c0:2000:6::8/64\
  inet6 2604:86c0:2000:6::9/64\
"
 
Good question. This is a better setup:

Code:
# IPv6
vlans_igb0="3005"
ifconfig_igb0_3005_ipv6="inet6 2604:86c0:2000:6::2/64"
ipv6_defaultrouter="2604:86c0:2000:6::1"
ifconfig_igb0_3005_aliases="\
  inet6 2604:86c0:2000:6::3/128\
  inet6 2604:86c0:2000:6::4/128\
  inet6 2604:86c0:2000:6::5/128\
  inet6 2604:86c0:2000:6::6/128\
  inet6 2604:86c0:2000:6::7/128\
  inet6 2604:86c0:2000:6::8/128\
  inet6 2604:86c0:2000:6::9/128\
"
 
Back
Top