IPV6 multiple addresses with same prefix

David Newman dnewman at networktest.com
Tue Oct 22 21:05:32 UTC 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/22/13 11:33 AM, Matthew Seaman wrote:
> On 22/10/2013 18:35, Steve O'Hara-Smith wrote:
>> Hi,
>> 
>> Does anyone here know of a way to set multiple IPV6 addresses
>> with the same prefix on an interface so that a jail can have it's
>> own IPV6 address ? When I try it ifconfig happily assigns the
>> second address but it gets flagged as 'duplicate' and no traffic
>> gets to the jail using /64 or /128 makes no difference, even
>> ping6 fails to get responses.
>> 
> 
> Works for me...

And for me as well.

Notice that in Matthew's rc.conf, all but the first address are aliases.

Same thing using ifconfig on the command line; just add the term
'alias' at the end of the command for the second and subsequent
addresses. This is true both for v4 and v6, e.g.:

ifconfig em0 inet 192.168.0.1/24
ifconfig em0 inet 192.168.0.2/24 alias

ifconfig em0 inet6 2604:0:c2:15::1/64
ifconfig em0 inet6 2604:0:c2:15::2/64 alias

And to get rid of them, use '-alias' or 'remove' with or without the
prefix length:

ifconfig em0 inet6 2604:0:c2:15::2/64 -alias
ifconfig em0 inet6 2604:0:c2:15::2 remove

These two are the same command.

dn




> 
> lucid-nonsense:/home/matthew:# ifconfig em0 em0:
> flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu
> 1500 
> options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
>
> 
ether 68:05:ca:0b:3d:42
> inet6 2001:8b0:151:1:3850:9ee6:9c6b:8a8b prefixlen 64 inet6
> fe80::6a05:caff:fe0b:3d42%em0 prefixlen 64 scopeid 0x5 inet
> 81.2.117.97 netmask 0xfffffff8 broadcast 81.2.117.103 inet6
> 2001:8b0:151:1:3cd3:cd67:fafa:3d78 prefixlen 64 inet6
> 2001:8b0:151:1:78ea:429a:bbd9:f62f prefixlen 64 inet6
> 2001:8b0:151:1:c2f:23d1:314c:5e2e prefixlen 64 inet6
> 2001:8b0:151:1:e2cb:4eff:fe26:6481 prefixlen 64 inet6
> 2001:8b0:151:1:38df:dfbd:32df:5017 prefixlen 64 inet6
> 2001:8b0:151:1:68b2:667a:d0cc:7c8f prefixlen 64 inet6
> 2001:8b0:151:1:18d3:a7d:fe4:1d6a prefixlen 64 inet6
> 2001:8b0:151:1:6a05:caff:fe0b:3d42 prefixlen 64 inet6
> 2001:8b0:151:1:: prefixlen 64 anycast inet6
> 2001:8b0:151:1:54f9:9484:e8b0:12d1 prefixlen 128 nd6
> options=21<PERFORMNUD,AUTO_LINKLOCAL> media: Ethernet autoselect
> (100baseTX <full-duplex>) status: active
> 
> ... and at least one of those IPv6 IPs is for a jail.  rc.conf
> settings are like so:
> 
> ipv6_prefix_em0="2001:8b0:151:1" ifconfig_em0_ipv6="inet6
> 2001:8b0:151:1:3850:9ee6:9c6b:8a8b/64" ifconfig_em0_alias0="inet6
> 2001:8b0:151:1:3cd3:cd67:fafa:3d78/64" ifconfig_em0_alias1="inet6
> 2001:8b0:151:1:78ea:429a:bbd9:f62f/64" ifconfig_em0_alias2="inet6
> 2001:8b0:151:1:c2f:23d1:314c:5e2e/64" ifconfig_em0_alias3="inet6
> 2001:8b0:151:1:e2cb:4eff:fe26:6481/64" ifconfig_em0_alias4="inet6
> 2001:8b0:151:1:38df:dfbd:32df:5017/64" ifconfig_em0_alias5="inet6
> 2001:8b0:151:1:68b2:667a:d0cc:7c8f/64" ifconfig_em0_alias6="inet6
> 2001:8b0:151:1:18d3:a7d:fe4:1d6a/64"
> 
> for the aliases, and like so:
> 
> jail_xenophobe_hostname="xenophobe.infracaninophile.co.uk" 
> jail_xenophobe_rootdir="/jail/xenophobe" 
> jail_xenophobe_ip="2001:8b0:151:1:54f9:9484:e8b0:12d1" 
> jail_xenophobe_mount_enable="YES" 
> jail_xenophobe_zfs="zroot/jail/xenophobe
> zroot/jail/xenophobe/TimeMachine" 
> jail_xenophobe_params="enforce_statfs=1"
> 
> for the jail.
> 
> Cheers,
> 
> Matthew
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlJm6JQACgkQyPxGVjntI4JAXACg9+nLAsxyLvR5gd2bf2lFNioY
yocAoKjXQTnpn5ld04rYZOESdr93qO7z
=plqY
-----END PGP SIGNATURE-----


More information about the freebsd-questions mailing list