From owner-freebsd-net@FreeBSD.ORG Wed Jan 13 16:23:05 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C81B1065692 for ; Wed, 13 Jan 2010 16:23:05 +0000 (UTC) (envelope-from Brett.Lee@Sun.COM) Received: from brmea-mail-1.sun.com (brmea-mail-1.Sun.COM [192.18.98.31]) by mx1.freebsd.org (Postfix) with ESMTP id 1AD208FC1B for ; Wed, 13 Jan 2010 16:23:05 +0000 (UTC) Received: from fe-amer-10.sun.com ([192.18.109.80]) by brmea-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id o0DGN4Us000683 for ; Wed, 13 Jan 2010 16:23:04 GMT MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) id <0KW7007001C8HU00@mail-amer.sun.com> for freebsd-net@freebsd.org; Wed, 13 Jan 2010 09:23:04 -0700 (MST) Received: from [192.168.1.11] ([unknown] [10.80.64.1]) by mail-amer.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) with ESMTPSA id <0KW700BOS1IDUO00@mail-amer.sun.com> for freebsd-net@freebsd.org; Wed, 13 Jan 2010 09:23:01 -0700 (MST) Date: Wed, 13 Jan 2010 09:22:58 -0700 From: Brett Lee In-reply-to: <25ff90d61001121642l7ac1de26ma7033ca997d90183@mail.gmail.com> Sender: Brett.Lee@Sun.COM To: freebsd-net@freebsd.org Message-id: <4B4DF362.9000007@Sun.COM> References: <4B4CEB41.3000805@Sun.COM> <25ff90d61001121642l7ac1de26ma7033ca997d90183@mail.gmail.com> User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) Subject: Re: How to enable IPv6 on a subset of interfaces X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 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, 13 Jan 2010 16:23:05 -0000 David Horn wrote: > On Tue, Jan 12, 2010 at 4:36 PM, Brett Lee wrote: >> Hello, >> >> Using FreeBSD 8.0-RELEASE, and am trying variations in /etc/rc.conf in an >> attempt to enable IPv6 on ONLY one of the systems two interfaces. >> >> Specifically, em0 should be enabled IPv4 DHCP, and bge0 should be enabled >> IPv6 only. >> >> From the KAME link below, and the files /etc/network.subr and >> /etc/defaults/rc.conf, am reading that "ipv6_network_interface" should work; >> however the following still results in em0 obtaining IPv6 addresses: >> >> http://www.kame.net/~suz/freebsd-ipv6-config-guide.txt >> >> ifconfig_em0="DHCP" >> ipv6_enable="YES" >> ipv6_network_interface="bge0" >> ipv6_network_interfaces="bge0" >> >> In another attempt (see link below), it looks like "ifconfig_em0" may >> support a "NOIPV6" param, but in practice it doesn't seem to work for me: >> >> http://lists.freebsd.org/pipermail/freebsd-rc/2007-May/001106.html >> >> ifconfig_em0="DHCP NOIPV6" >> ipv6_enable="YES" >> #ipv6_network_interface="bge0" >> #ipv6_network_interfaces="bge0" >> >> Am hopeful that someone might point out how I could enable this >> configuration. >> >> Thanks in advance! -Brett > > NOIPV6 is not a valid rc.conf configuration token at this time. > > I am assuming that you are using SLAAC for IPv6 prefix/address > distribution (via rtadvd/radvd), and not DHCPv6. > > ipv6_network_interfaces is the correct rc.conf(5) variable to use to > specifically control which interface gets configured using SLAAC via > rtsol(8), but will not stop other interfaces from getting the RA > (Router Advertisement) packet which starts IPv6 SLAAC (Stateless > Autoconfiguration). > > In -current/9.0 there are nice new ifconfig parameters (inet6 > ifdisabled -nud -accept_rtadv) and rc.conf variables that do just what > you are looking for, but they are not in 8.0 at this time. > > In 8.0 you can use the ndp(8) utility to set the -accept_rtadv (and/or > ifdisabled/nud,etc.) flags on a per-interface basis. The > "-accept_rtadv" flag will disable SLAAC for the specified interface, > but must be called before the interface gets the "RA" packet to be > effective. > > You can do an ugly *unsupported hack* in 8.0 to call ndp from within > rc.conf/rc.d startup scripts until the new code makes it into a > release: > > ipv6_enable="YES" > ipv6_network_interfaces="bge0" > ifconfig_em0="DHCP `ndp -i em0 ifdisabled -nud -accept_rtadv >/dev/null 2>&1`" > ifconfig_bge0="UP" > > This will cause some boot-time error messages about not finding ndp > (before /usr is mounted), but these can be ignored, as the backticked > ndp line will be run EVERY time that rc.conf is sourced. This is > just a work-around for 8.0 that happened to work for me at the time. > If someone else has a better solution that fits properly within the > confines of rc.conf, please speak up. > > While on the subject, I have been thinking about putting together a > patchset to experiment with adding some improved logic surrounding > using DHCPv6 vs DHPCPv4 vs SLAAC/RTSOL in the rc.conf scripts and > adding M+0 flag support +rdnss (RFC 5006) support to the kernel and > userland and devd. If I can ever get a working prototype, I will > share to get some feedback. > > Good Luck. > > ---Dave Horn In trying this: ifconfig_em0="DHCP `ndp -i em0 (if?)disabled -nud -accept_rtadv >/dev/null 2>&1`" it seems like it will be "good enough" for our purposes. The em0 interface is not collecting the global SLAAC prefix and forming a global address; it is not learning about routers on that subnet; it is also not collecting reachability information about neighbors. The last one is probably the most important to us. The goal was to eliminate all global AND link local addressing/routing on em0, however, it was mentioned in one of the replies that this is not possible. This question arose from an effort is to use FreeBSD 8.0 to verify a test platform that consists of the myriad of Tahi IPv6 test suites, while still maintaining direct connectivity between this host and the v4/v6 LANs. With the solution above, I expect that this will suffice for our purposes. If not, will fall back to the serial console. Thanks everyone for your replies/suggestions! -Brett