Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Jan 2014 04:55:18 -0800
From:      Darren Pilgrim <list_freebsd@bluerosetech.com>
To:        freebsd-rc <freebsd-rc@freebsd.org>
Subject:   gifconfig, gif_up() and IPv6 tunnels
Message-ID:  <52CAA7B6.1050209@bluerosetech.com>

next in thread | raw e-mail | index | archive | help
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?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52CAA7B6.1050209>