From owner-freebsd-net@FreeBSD.ORG Wed Aug 27 06:31:25 2014 Return-Path: Delivered-To: freebsd-net@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 ESMTPS id 20A3C3C9 for ; Wed, 27 Aug 2014 06:31:25 +0000 (UTC) Received: from bravo.jonathanprice.org (bravo.jonathanprice.org [5.135.154.174]) by mx1.freebsd.org (Postfix) with ESMTP id D7FE23943 for ; Wed, 27 Aug 2014 06:31:24 +0000 (UTC) Received: by bravo.jonathanprice.org (Postfix, from userid 58) id 20143F80; Wed, 27 Aug 2014 06:31:22 +0000 (UTC) Received: from [192.168.1.150] (host86-156-241-97.range86-156.btcentralplus.com [86.156.241.97]) by bravo.jonathanprice.org (Postfix) with ESMTPSA id B23B7F7B; Wed, 27 Aug 2014 06:31:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=jonathanprice.org; s=default; t=1409121079; bh=yvFi+moUAzsyOKVnFnRoyzIxlv2wi1IELsH8tm4OQ4A=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=T2+p6qvEwWqTyp7cKNuKf36YD6caf7ciEBx0CGqix3Y8QDDzpQAbjbeb7F+aQ1yft AMDQVvunBCNDD2YtsAZCIyzej0RI3IyrECyYAfMSIAyw/b2NDlfqJTwCH5kZOyHojP Xzfq291FYje+4sJLEi0raR2tsMMkFisqn6NiubW8= Message-ID: <53FD7B34.1050408@jonathanprice.org> Date: Wed, 27 Aug 2014 07:31:16 +0100 From: Jonathan Price User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: Re: Should I be using ipv6_activate_all_interfaces or ip6addrctl_policy="ipv6_prefer" References: <88a42e1006e3fac7508a9419e342f1b2@mail.jonathanprice.org> <2173103.SJdXL7NPLT@overcee.wemm.org> In-Reply-To: <2173103.SJdXL7NPLT@overcee.wemm.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: peter@wemm.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Aug 2014 06:31:25 -0000 On 2014-08-27 01:40, Peter Wemm wrote: > On Tuesday 26 August 2014 10:40:27 freebsd@jonathanprice.org wrote: >> Hello, >> >> I am configuring a server with IPv4 and IPv6 addresses and have noticed that >> FreeBSD seems to be preferring IPv4, such as when establishing SSH >> connections. >> >> After reading through /etc/defaults/rc.conf, and later /etc/rc.d/ip6addrctl >> I have come to the conclusion that I have two ways to tell FreeBSD to >> prefer IPv6: >> >> 1) Add ipv6_activate_all_interfaces to /etc/rc.conf >> 2) Add ip6addrctl_policy="ipv6_prefer" to /etc/rc.conf >> >> Could anybody with a little more knowledge on the matter explain to me which >> of the two options is more preferential? > > They both do different things. > > The activate knob is to enable ipv6 on an interface. To oversimplify it, if > you configure an address on an interface, it is "enabled". However, this > switch enables this on all the rest of the interfaces, even the ones you > didn't configure. > > ip6addrctl* affects things like hostname lookups to sort the addresses returned > to the caller. > > They are different things entirely. I think you are expecting the behavior > that ip6_prefer policy gives you. That's what we use in the freebsd.org > cluster to have it use ipv6 where possible. > Hi, and thanks for the response. Would it be possible to go into a little detail as to what ipv6_activate_all_interfaces="YES" does to interfaces which don't explicitly have an address configured? I can't appear to find much information on this option. However, it does sound like for my purposes it would make more sense to use ip6addrctl_policy="ipv6_prefer" as that is more explicitly the feature I want, rather than getting it inadvertently through the other knob. As to Kevin's question, I have working IPv6 connectivity both with and without the knobs in mention, it's just that certain applications which can use both IPv4 and IPv6 (such as SSH), won't use IPv6 unless explicitly told to (with -6 in this example), or one of the above tunables is used.