Bug 97014 - [gif] gifconfig_gif? in rc.conf does not recognize IPv6 address
Summary: [gif] gifconfig_gif? in rc.conf does not recognize IPv6 address
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 6.1-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-09 04:50 UTC by TANABE Hiroyasu
Modified: 2018-04-21 19:25 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description TANABE Hiroyasu 2006-05-09 04:50:18 UTC
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.

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"
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`
Comment 1 Matteo Riondato freebsd_committer freebsd_triage 2006-05-17 13:25:15 UTC
State Changed
From-To: open->feedback
Comment 2 Matteo Riondato freebsd_committer freebsd_triage 2006-05-17 13:26:51 UTC
State Changed
From-To: feedback->open

Reset status to open: I set it to feedback 'cause I mistyped PR number
Comment 3 Bruce Cran freebsd_committer freebsd_triage 2010-11-14 20:35:21 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-net

Over to maintainer(s).
Comment 4 bzeeb-lists 2010-11-18 06:11:48 UTC
Put an "inet6" in front of the addresses, like you would do for
ifconfig.

- gifconfig_gif0="2001:DB8:0001::1 2001:DB8:0001::2"
+ gifconfig_gif0="inet6 2001:DB8:0001::1 2001:DB8:0001::2"

does that help?
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:11 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 6 Eugene Grosbein freebsd_committer freebsd_triage 2018-04-21 19:25:14 UTC
Here is how do you do that these days:

cloned_interfaces="gif0"
create_args_gif0="inet6 tunnel 2001:DB8:0001::1 2001:DB8:0001::2"
ifconfig_gif0="inet 192.0.2.1 192.0.2.2 netmask 0xffffffff"