From owner-freebsd-questions@FreeBSD.ORG Tue Oct 22 21:05:32 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 12EC1A1E for ; Tue, 22 Oct 2013 21:05:32 +0000 (UTC) (envelope-from dnewman@networktest.com) Received: from mail5.networktest.com (mail5.networktest.com [204.109.60.142]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CCFFC28AC for ; Tue, 22 Oct 2013 21:05:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail5.networktest.com (Postfix) with ESMTP id BDF332FCCA9 for ; Tue, 22 Oct 2013 14:05:25 -0700 (PDT) Received: from mail5.networktest.com ([127.0.0.1]) by localhost (mail5.networktest.com [127.0.0.1]) (maiad, port 10024) with ESMTP id 58584-07 for ; Tue, 22 Oct 2013 14:05:25 -0700 (PDT) Received: from dhcp130.eng.networktest.com (ns.networktest.com [205.147.16.129]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: dnewman@networktest.com) by mail5.networktest.com (Postfix) with ESMTPSA id 79B252FCC96 for ; Tue, 22 Oct 2013 14:05:25 -0700 (PDT) Message-ID: <5266E895.60408@networktest.com> Date: Tue, 22 Oct 2013 14:05:25 -0700 From: David Newman Organization: Network Test Inc. User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: IPV6 multiple addresses with same prefix References: <20131022183548.9b18fc59e4374e7274d0e116@sohara.org> <5266C50B.9050102@FreeBSD.org> In-Reply-To: <5266C50B.9050102@FreeBSD.org> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 21:05:32 -0000 -----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 metric 0 mtu > 1500 > options=4219b > > 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 media: Ethernet autoselect > (100baseTX ) 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-----