conf/97014: gifconfig_gif? in rc.conf does not recognize IPv6 address

TANABE Hiroyasu h at cosat.com
Tue May 9 03:50:28 UTC 2006


>Number:         97014
>Category:       conf
>Synopsis:       gifconfig_gif? in rc.conf does not recognize IPv6 address
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 09 03:50:18 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     TANABE Hiroyasu
>Release:        6.1-RELEASE
>Organization:
Cosat Inc.
>Environment:
FreeBSD fw7.zeon2k.g.cosat.com 6.1-RELEASE FreeBSD 6.1-RELEASE #3: Mon May  8 04:38:55 JST 2006     h at fw7.zeon2k.g.cosat.com:/usr/obj/usr/src/sys/COSATFW3  i386

>Description:
My FreeBSD box has a "IPv4 over IPv6" tunnel.

It was configured in 5.4-RELEASE by rc.conf shown below:
  gif_interfaces="YES"
  gif_interfaces="gif0"
  gifconfig_gif0="2001:DB8:0001::1 2001:DB8:0001::2"
  ifconfig_gif0="inet 192.0.2.1 netmask 0xffffffff 192.0.2.2"

But it does not work in 6.1-RELEASE.

It seemes to be caused by a difference of /sbin/ifconfig.

>How-To-Repeat:
'ifconfig gif0 tunnel 2001:DB8:0001::1 2001:DB8:0001::2' 
works in FreeBSD 5.4.

The command does not work in FreeBSD 6.1 with error:
`ifconfig: SIOCSIFPHYADDR: Address family not supported by protocol family`

>Fix:
Now I'm using a local script shown below,
but I think /etc/network.subr should be revised.
--------
#!/bin/sh
#

# PROVIDE: gifipv6
# REQUIRE: root mountcritlocal netif
# BEFORE:  routing
# KEYWORD: nojail

. /etc/rc.subr

name="gifipv6"
rcvar=`set_rcvar`
load_rc_config $name
start_cmd="gif_ipv6_start"

gif_ipv6_start()
{
        case ${gif_interfaces} in
        [Nn][Oo] | '')
                ;;
        *)
                for i in ${gif_interfaces}; do
                        eval peers=\$gifv6config_$i
                        case ${peers} in
                        '')
                                continue
                                ;;
                        *)
                                ifconfig $i create >/dev/null 2>&1
                                ifconfig $i inet6 tunnel ${peers}
                                ifconfig $i up
                                ;;
                        esac
                done
                ;;
        esac
}

run_rc_command "$1"

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list