Date: Tue, 12 Jan 2010 19:42:00 -0500 From: David Horn <dhorn2000@gmail.com> To: Brett Lee <Brett.Lee@sun.com> Cc: freebsd-net@freebsd.org Subject: Re: How to enable IPv6 on a subset of interfaces Message-ID: <25ff90d61001121642l7ac1de26ma7033ca997d90183@mail.gmail.com> In-Reply-To: <4B4CEB41.3000805@Sun.COM> References: <4B4CEB41.3000805@Sun.COM>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jan 12, 2010 at 4:36 PM, Brett Lee <Brett.Lee@sun.com> 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 wo= rk; > however the following still results in em0 obtaining IPv6 addresses: > > http://www.kame.net/~suz/freebsd-ipv6-config-guide.txt > > ifconfig_em0=3D"DHCP" > ipv6_enable=3D"YES" > ipv6_network_interface=3D"bge0" > ipv6_network_interfaces=3D"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=3D"DHCP NOIPV6" > ipv6_enable=3D"YES" > #ipv6_network_interface=3D"bge0" > #ipv6_network_interfaces=3D"bge0" > > Am hopeful that someone might point out how I could enable this > configuration. > > Thanks in advance! =A0-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=3D"YES" ipv6_network_interfaces=3D"bge0" ifconfig_em0=3D"DHCP `ndp -i em0 ifdisabled -nud -accept_rtadv >/dev/null 2= >&1`" ifconfig_bge0=3D"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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?25ff90d61001121642l7ac1de26ma7033ca997d90183>