From owner-freebsd-bugs@FreeBSD.ORG Tue Nov 15 10:40:18 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E048E16A41F for ; Tue, 15 Nov 2005 10:40:17 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48ADE43D46 for ; Tue, 15 Nov 2005 10:40:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id jAFAeG1S003979 for ; Tue, 15 Nov 2005 10:40:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id jAFAeGm1003978; Tue, 15 Nov 2005 10:40:16 GMT (envelope-from gnats) Resent-Date: Tue, 15 Nov 2005 10:40:16 GMT Resent-Message-Id: <200511151040.jAFAeGm1003978@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Antonio Querubin Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4919E16A41F for ; Tue, 15 Nov 2005 10:36:38 +0000 (GMT) (envelope-from tony@lava.net) Received: from gau.lava.net (gau.lava.net [64.65.64.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1374343D45 for ; Tue, 15 Nov 2005 10:36:37 +0000 (GMT) (envelope-from tony@lava.net) Received: from _HOSTNAME_ (cust11798.lava.net [64.65.78.22]) by gau.lava.net (Postfix) with SMTP id 229B7355C7 for ; Tue, 15 Nov 2005 00:36:37 -1000 (HST) Received: by _HOSTNAME_ (sSMTP sendmail emulation); Tue, 15 Nov 2005 00:36:33 -1000 Message-Id: <20051115103637.229B7355C7@gau.lava.net> Date: Tue, 15 Nov 2005 00:36:33 -1000 From: "Antonio Querubin" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: conf/89061: IPv6 6to4 auto-configuration enhancement X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Antonio Querubin List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2005 10:40:18 -0000 >Number: 89061 >Category: conf >Synopsis: IPv6 6to4 auto-configuration enhancement >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Nov 15 10:40:15 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Antonio Querubin >Release: FreeBSD 5.4-STABLE i386 >Organization: none >Environment: System: FreeBSD pavilion 5.4-STABLE FreeBSD 5.4-STABLE #1: Tue Aug 16 00:43:55 HST 2005 root@pavilion:/usr/obj/usr/src/sys/GENERIC i386 >Description: When IPv6 is enabled in /etc/rc.conf but there is no native IPv6 routing, 6to4 can be enabled with some reasonable defaults to provide IPv6 connectivity via the nearest 6to4 anycast router (RFC 3068). This patch enhances the IPv6 startup script to automatically setup the stf interface address and the IPv6 default gateway properly if 'auto6to4_enable=YES' is added to /etc/rc.conf to enable this feature. This provides a simple, working IPv6 configuration for a large majority of workstations still on IPv4-only networks. This is similar to the default 6to4 behaviour in Linux and MS Windows XP. >How-To-Repeat: With IPv6 enabled ('ipv6_enable=YES' added to /etc/rc.conf) in a non-IPv6 network, attempt to ping a IPv6 host. example: ping6 www.isc.org The ping6 attempt should fail as there is no IPv6 route to the host. Install the patch below and add 'auto6to4_enable=YES' to /etc/rc.conf and reboot. ping6 and traceroute6 should now work to a number of IPv6 hosts. >Fix: --- /usr/src/etc/rc.d/network_ipv6 Sun Oct 17 11:00:07 2004 +++ /etc/rc.d/network_ipv6 Sat Nov 12 09:16:54 2005 @@ -100,6 +100,25 @@ fi # Setup IPv6 to IPv4 mapping + if checkyesno auto6to4_enable; then + # Determine the interface of the IPv4 default route. + ipv4_default_if=`route get default \ + | awk '/interface:/ {print $NF}'` + # Define the 6to4 tunnel's IPv4 address to match the first + # IPv4 address of the IPv4 default interface. + stf_interface_ipv4addr=`ifconfig ${ipv4_default_if} inet \ + | awk '/inet/ {print $2}' \ + | head -1` + # If no IPv6 default gateway is defined, use the RFC 3068 + # anycast address. + case ${ipv6_defaultrouter} in + [Nn][Oo] | '') + ipv6_defaultrouter="2002:c058:6301::" + ;; + *) + ;; + esac + fi network6_stf_setup # Install the "default interface" to kernel, which will be used >Release-Note: >Audit-Trail: >Unformatted: