Setting up IPv6 in /etc/rc.conf

Mark Atkinson atkin901 at
Fri Oct 15 18:28:17 UTC 2010

Hash: SHA1

On 10/15/2010 11:04, Mark Murray wrote:
> Hi
> IPv6 gurus: what are the CURRENT /etc/rc.conf incantations to do the
> following (which works):
> $ ifconfig gif0 create
> $ ifconfig gif0 tunnel
> $ ifconfig gif0 inet6 2001:1111:2222:3333::2 2001:1111:2222:3333::1 prefixlen 128
> $ route -n add -inet6 default 2001:1111:2222:3333::1
> $ ifconfig gif0 up
> ... when my non-working setup in /etc/rc.conf contains
> gif_interfaces="gif0"
> gifconfig_gif0=""
> gifconfig_gif0_ipv6="2001:1111:2222:3333::2 2001:1111:2222:3333::1 prefixlen 128"
> ipv6_defaultrouter="-inet6 default 2001:1111:2222:3333::1"
> ... which used to work. The bit that fails is the bit where gif0 gets
> its tunnel IPv6 addresses.  I've tried both gifconfig_gif0_ipv6="..."
> and ifconfig_gif0_ipv6="...". The IPv6 endmpoints never make it onto
> gif0.
> This used to work, but setting up IPv6 in CURRENT is a moving
> target, and I can't find a working example any more. I've looked in
> /etc/defaults/rc.conf, but the gifN examples there are all devoid of any
> IPv6 examples.

I found that my ipv6 tunnel setup needed to be dead last in startup.  I
could not get it to configure properly via rc.conf and come up.   So I
just  setup the following script to run after the system comes up (using
your ip examples):

/etc/rc.d/rtadvd stop
ifconfig gif0 inet6  2002001:1111:2222:3333::2 2001:1111:2222:3333::1
prefixlen 128
ifconfig gif0 inet6 -ifdisabled
route add -inet6 default 2001:1111:2222:3333::1
ifconfig internal inet6  2001:1111:4444:3333::/64 eui64
ifconfig internal inet6 -ifdisabled
/etc/rc.d/rtadvd start
Version: GnuPG v2.0.16 (FreeBSD)
Comment: Using GnuPG with Mozilla -


More information about the freebsd-current mailing list