Page MenuHomeDevCentral

Parse IPv6 aliases from FreeBSD rc configuration correctly
ClosedPublic

Authored by dereckson on Sat, Sep 12, 21:51.

Details

Summary

After rebooting WindRiver, the IPv6 alias for the IRC bots was not configured.

Use ifconfig_<interface>_alias<number> instead of
<ifconfig_<interface>_ipv6_alias<number>, as /etc/network.subr only looks
for the former when parsing interface aliases:

for alias in `list_vars ifconfig_${_vif}_alias[0-9]\* |
    sort_lite -nk1.$((9+${#_vif}+7))`
do
    eval ifconfig_args=\"\$$alias\"
    # ... logic to check for "inet6" keyword in $ifconfig_args ...
done

Start IPv6 aliases at index 600 to avoid conflicts with IPv4 aliases.

As there is no plan to run a massive NAT gateway or a CDN edge node,
the 600 offset is perfectly safe for the netif templates.

References:

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson created this revision.
WindRiver
$ salt-call --local state.apply roles/core/network/ipv6          
[…]
----------
          ID: /etc/rc.conf.d/netif/ipv6_igb0
    Function: file.managed
      Result: True
     Comment: File /etc/rc.conf.d/netif/ipv6_igb0 updated
     Started: 21:54:49.030119
    Duration: 21.058 ms
     Changes:   
              ----------
              diff:
                  --- 
                  +++ 
                  @@ -14,5 +14,5 @@
                   #   </auto-generated>
                   
                   ifconfig_igb0_ipv6="inet6 2001:bc8:2e84:700::da7a:7001 prefixlen 56"
                  -ifconfig_igb0_ipv6_alias1="inet6 2001:bc8:2e84:700:0:dead:c0de:b07 prefixlen 56"
                  +ifconfig_igb0_alias600="inet6 2001:bc8:2e84:700:0:dead:c0de:b07 prefixlen 56"
[…]
This revision is now accepted and ready to land.Sat, Sep 12, 21:56