IPv6 aliases on rc.conf?

Hi there

I've got a /64 IPv6 Subnet registered by RIPE with my name on my own company now. And now I want to have some IPv6 Aliases starting automatically after each reboot. On /etc/rc.conf I've tried
Code:
ipv6_ifconfig_bge0_alias0="my_ipv6_address prefixlen 64"
without success
What will be the correct way?

cheers
Darko
 
My full IPv6 config parameters are:
Code:
ipv6_enable="YES"
ipv6_defaultrouter="2001:ffff:ffff::1"
ipv6_ifconfig_em0="2001:ffff:ffff::2/64"

I don't use multiple addresses.
All the possible parameters are documented on the rc.conf(5) manual page.
 
Not true, it is possible to use multiple adresses on a specific interface.
Here's my /etc/rc.conf relevant contents:

Code:
ipv6_enable="YES"
ipv6_ifconfig_em0="fec0:0:0:1::80/64"
ipv6_ifconfig_em0_alias0="fec0:0:0:2::80/64"
ipv6_ifconfig_em0_alias1="fec0:0:0:3::80/64"

I used only site-local addresses on my example. The machine automatically gets a link-local address if ipv6 is enabled.
Just make sure that you start numbering aliases from 0.
You can restart (to be more specific: enable new configured addresses) ipv6 network using
Code:
/etc/rc.d/network_ipv6 restart
 
This is all literally in rc.conf(5)

FreeBSD 8.x
Code:
     ipv6_network_interfaces
                 (str) This is the IPv6 equivalent of network_interfaces.
                 Instead of setting the ifconfig variables as
                 ifconfig_<interface> they should be set as
                 ipv6_ifconfig_<interface>.  Aliases should be set as
                 ipv6_ifconfig_<interface>_alias<n>.
FreeBSD 9.x
Code:
     ifconfig_<interface>_ipv6
                 (str) IPv6 functionality on an interface should be configured
                 by ifconfig_<interface>_ipv6, instead of setting ifconfig
                 parameters in ifconfig_<interface>.  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"
 
This is all literally in rc.conf(5)
How do you configure both an IP and IPv6 alias on FreeBSD 10.3? I tried:
Code:
ifconfig_ix0_alias0="inet 10.20.30.250 netmask 0xffffffff inet6 1020:30:1:2::250"
and
Code:
ifconfig_ix0_alias0="inet 10.20.30.250 netmask 0xffffffff"
ifconfig_ix0_alias0="inet6 1020:30:1:2::250"
The first didn't set the IPv6 address, and the second didn't set the IP address (presumably due to having two different ifconfig_ix0_alias0_ipv6 lines, and the last one seen taking precedence). Neither one logged anything relevant to the console during boot.

This started out on FreeBSD 8.4 as:
Code:
ifconfig_ix0_alias0="inet 10.20.30.250 netmask 0xffffffff"
ipv6_ifconfig_ix0_alias0="1020:30:1:2::250"
However, that gives me the warning about ipv6_ifconfig_ix0_alias0 being deprecated in 10.3.
 
How do you configure both an IP and IPv6 alias on FreeBSD 10.3?
Well, the example which you set up 2 aliases should work. But obviously you can't use alias0 two times, also see rc.conf(5). So I'd wager:

Code:
ifconfig_ix0_alias0="inet 10.20.30.250 netmask 0xffffffff"
ifconfig_ix0_alias1="inet6 1020:30:1:2::250"
This is of course assuming that the IPv4 part is also an alias and not the main IP address which you wanted to use. (edit) Note: you probably need to specify a netmask with the IPv6 part. But that's speculation on my end right now, however based on what I picked up in the manualpage.
 
For IPv4 I have:
Code:
ifconfig_em0="inet 1.2.3.4 netmask yournetmask"
ifconfig_em0_alias1="inet 1.2.3.5 netmask yournetmask"

for IPv6:
Code:
ifconfig_em0_ipv6="inet6 youripv6 prefixlen 64"
ifconfig_em0_alias1_ipv6="inet6 youripv6 prefixlen 64"

basically the same. After changing make sure you restart network with:
service netif restart && service routing restart
 
Well, the example which you set up 2 aliases should work. But obviously you can't use alias0 two times, also see rc.conf(5). So I'd wager:

Code:
ifconfig_ix0_alias0="inet 10.20.30.250 netmask 0xffffffff"
ifconfig_ix0_alias1="inet6 1020:30:1:2::250"
This is of course assuming that the IPv4 part is also an alias and not the main IP address which you wanted to use.
Thanks. I used:
Code:
ifconfig_ix0_alias0="inet 10.20.30.250 netmask 0xffffffff"
ifconfig_ix0_alias1_ipv6="inet6 1020:30:1:2::250"
and so forth for the various aliases.
(edit) Note: you probably need to specify a netmask with the IPv6 part. But that's speculation on my end right now, however based on what I picked up in the manualpage.
If the alias is on the same subnet as the main interface, it inherits the mask of the main interface.

When I did:
Code:
(0:1) host:/etc# /etc/rc.d/netif restart
I got:
Code:
ifconfig: ioctl (SIOCDIFADDR): Can't assign requested address
ifconfig: ioctl (SIOCDIFADDR): Can't assign requested address
but that is probably due to the IPv4 addresses already being present as aliases. I'll check to make sure nothing like that is logged the next time I reboot.
 
Back
Top