From owner-freebsd-rc@FreeBSD.ORG Mon Jan 6 12:55:44 2014 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D794F2B2 for ; Mon, 6 Jan 2014 12:55:44 +0000 (UTC) Received: from yoshi.bluerosetech.com (yoshi.bluerosetech.com [174.136.100.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BF5781E72 for ; Mon, 6 Jan 2014 12:55:44 +0000 (UTC) Received: from chombo.houseloki.net (unknown [IPv6:2601:7:16c0:b50:21c:c0ff:fe7f:96ee]) by yoshi.bluerosetech.com (Postfix) with ESMTPSA id 9EE74E60FC for ; Mon, 6 Jan 2014 04:55:37 -0800 (PST) Received: from [IPv6:2601:7:16c0:b50:ed0b:a3c0:54d2:fc39] (unknown [IPv6:2601:7:16c0:b50:ed0b:a3c0:54d2:fc39]) by chombo.houseloki.net (Postfix) with ESMTPSA id EA1DA561 for ; Mon, 6 Jan 2014 04:55:21 -0800 (PST) Message-ID: <52CAA7B6.1050209@bluerosetech.com> Date: Mon, 06 Jan 2014 04:55:18 -0800 From: Darren Pilgrim User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: freebsd-rc Subject: gifconfig, gif_up() and IPv6 tunnels Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2014 12:55:44 -0000 I'm setting up some 4in6 tunnels using gif interfaces on 9.2-R. On the command line, they look like this: # ifconfig gif0 create # ifconfig gif0 ipv6 tunnel 2001:db8:1::1 2001:db8:2::1 mtu 1500 -accept_rtadv # ifconfig gif0 inet 10.0.1.1 10.0.2.1 netmask 0xffffffff When I went to add it to /etc/rc.conf, I ran into a problem. The gif_up() function hardcodes the contents of gifconfig_gif0 after the tunnel keyword, but ifconfig requires putting "inet6" before "tunnel" for IPv6 tunnels. Ironically, ifconfig's output for such interfaces has those keywords transposed. I didn't see any logic in network.subr to detect IPv4 vs IPv6 gif tunnels. I worked around it using a hack with cloned_interfaces and aliases: cloned_interfaces="gif0" ifconfig_gif0="inet6 tunnel 2001:db8:1::1 2001:db8:2::1 mtu 1500" ifconfig_gif0_alias0="inet 10.0.1.1 10.0.2.1 netmask 0xffffffff" It seems like this is something network.subr should know how to do properly (i.e., feature parity with IPv4). Did I overlook a formal way to configure IPv6 gif tunnels in /etc/rc.conf? If this isn't possible, has this functionality been added to -current? If not, is anyone working on it?